struct
Movie::Remote::WireEnvelope
- Movie::Remote::WireEnvelope
- Struct
- Value
- Object
Overview
WireEnvelope is the envelope used for serializing messages over the wire. Connection-owned decoders can retain registered payloads as typed wrappers; stateless, unknown, and payload-before-type decoding retains raw JSON. All outbound serializable values write directly to JSON::Builder.
Defined in:
movie/remote/wire_envelope.crConstructors
-
.ask_request(target_path : String, message_type : String, payload : P, correlation_id : String, sender_path : String | Nil = nil) : WireEnvelope forall P
Creates an ask request envelope.
-
.ask_response(target_path : String, message_type : String, payload : P, correlation_id : String) : WireEnvelope forall P
Creates an ask response envelope.
- .control_ack(stream : String, sequence : Int64) : WireEnvelope
-
.handshake(system_name : String, address : String) : WireEnvelope
Compatibility helper for callers that do not need custom association settings.
-
.handshake(handshake : AssociationHandshake) : WireEnvelope
Creates a handshake envelope.
- .handshake_ack(handshake : AssociationHandshake) : WireEnvelope
- .handshake_confirm(confirmation : AssociationConfirmation) : WireEnvelope
- .handshake_ready(association_id : String) : WireEnvelope
- .handshake_reject(reason : String) : WireEnvelope
-
.heartbeat : WireEnvelope
Creates a heartbeat envelope.
- .heartbeat_ack : WireEnvelope
- .new(kind : Kind, target_path : String, message_type : String, payload : P, correlation_id : String | Nil = nil, sender_path : String | Nil = nil, timestamp : Int64 = Time.utc.to_unix_ms, control_stream : String | Nil = nil, control_sequence : Int64 | Nil = nil) forall P
- .new(pull : JSON::PullParser, payload_decoder : JsonPayloadDecoder | Nil = nil)
-
.system_message(target_path : String, message_type : String, payload : P, sender_path : String | Nil = nil) : WireEnvelope forall P
Creates a system message envelope.
-
.user_message(target_path : String, message_type : String, payload : P, sender_path : String | Nil = nil) : WireEnvelope forall P
Creates a user message envelope.
Instance Method Summary
- #control_sequence : Int64 | Nil
- #control_sequence=(control_sequence : Int64 | Nil)
- #control_stream : String | Nil
- #control_stream=(control_stream : String | Nil)
- #correlation_id : String | Nil
- #correlation_id=(correlation_id : String | Nil)
- #kind : Kind
- #kind=(kind : Kind)
- #message_type : String
- #message_type=(message_type : String)
-
#payload : JSON::Any
Dynamic payload access is materialized lazily.
- #payload=(value : JSON::Any) : JSON::Any
- #payload_data : JsonPayload
- #sender_path : String | Nil
- #sender_path=(sender_path : String | Nil)
- #target_path : String
- #target_path=(target_path : String)
- #timestamp : Int64
- #timestamp=(timestamp : Int64)
- #to_json(json : JSON::Builder) : Nil
Constructor Detail
Creates an ask request envelope.
Creates an ask response envelope.
Compatibility helper for callers that do not need custom association settings. It still emits the current versioned handshake.
Creates a handshake envelope.
Creates a system message envelope.
Creates a user message envelope.
Instance Method Detail
Dynamic payload access is materialized lazily. Normal registered message delivery uses payload_data and does not build JSON::Any.