struct Obsctl::IPC::Request

Overview

A single newline-delimited IPC request received by the daemon.

Requests are either command invocations or long-lived topic subscriptions.

Defined in:

obsctl/ipc/request.cr

Constant Summary

TYPE_COMMAND = "command"
TYPE_SUBSCRIBE = "subscribe"

Constructors

Instance Method Summary

Constructor Detail

def self.new(id : String, type : String, command : CommandPayload | Nil = nil, topics : Array(String) = [] of String) #

[View source]

Instance Method Detail

def clone #

[View source]
def command : CommandPayload | Nil #

def command? : Bool #

Returns true when this request carries a command payload.


[View source]
def copy_with(id _id = @id, type _type = @type, command _command = @command, topics _topics = @topics) #

[View source]
def id : String #

def subscribe? : Bool #

Returns true when this request asks the server to register topic pushes.


[View source]
def to_json(json : JSON::Builder) : Nil #

Writes the wire-format JSON object for this request.


[View source]
def topics : Array(String) #

def type : String #