struct

Movie::Remote::WireEnvelope

Inherits JSON::Serializable < Struct < Value < Object

WireEnvelope is the envelope used for serializing messages over the wire. It contains metadata about the message type and payload.

Constructors

ask_request(target_path : String, message_type : String, payload : JSON::Any, correlation_id : String, sender_path : String | Nil = nil) : WireEnvelope

Creates an ask request envelope.

Source
ask_response(target_path : String, message_type : String, payload : JSON::Any, correlation_id : String) : WireEnvelope

Creates an ask response envelope.

Source
handshake(system_name : String, address : String) : WireEnvelope

Creates a handshake envelope.

Source
heartbeat

Creates a heartbeat envelope.

Source
new(kind : Kind, target_path : String, message_type : String, payload : JSON::Any, correlation_id : String | Nil = nil, sender_path : String | Nil = nil, timestamp : Int64 = Time.utc.to_unix_ms)
Source
new(*, __pull_for_json_serializable pull : JSON::PullParser)
Source
system_message(target_path : String, message_type : String, payload : JSON::Any, sender_path : String | Nil = nil) : WireEnvelope

Creates a system message envelope.

Source
user_message(target_path : String, message_type : String, payload : JSON::Any, sender_path : String | Nil = nil) : WireEnvelope

Creates a user message envelope.

Source

Instance methods

correlation_id

Correlation ID for request-reply patterns (ask). Used to match responses to their requests.

Source
correlation_id=(correlation_id : String | Nil)

Correlation ID for request-reply patterns (ask). Used to match responses to their requests.

Source
kind

The kind of this envelope.

Source
kind=(kind : Kind)

The kind of this envelope.

Source
message_type

The type tag of the serialized message (for deserialization).

Source
message_type=(message_type : String)

The type tag of the serialized message (for deserialization).

Source
payload

The serialized message payload as JSON.

Source
payload=(payload : JSON::Any)

The serialized message payload as JSON.

Source
sender_path

The path of the sending actor (nil for system/anonymous senders).

Source
sender_path=(sender_path : String | Nil)

The path of the sending actor (nil for system/anonymous senders).

Source
target_path

The path of the target actor.

Source
target_path=(target_path : String)

The path of the target actor.

Source
timestamp

Timestamp when the message was sent (epoch milliseconds).

Source
timestamp=(timestamp : Int64)

Timestamp when the message was sent (epoch milliseconds).

Source

Nested types