abstract class
ACP::Transport
- ACP::Transport
- Reference
- Object
Overview
Abstract base class for all ACP transports. Subclasses must implement the raw read/write operations; the base class provides the JSON parsing/serialization layer on top.
Direct Known Subclasses
Defined in:
acp/transport.crInstance Method Summary
-
#close : Nil
Closes the transport, releasing any underlying resources.
-
#closed? : Bool
Returns true if the transport is open and operational.
-
#receive : JSON::Any | Nil
Receives the next incoming JSON message, blocking until one arrives.
-
#send(message : Hash(String, JSON::Any)) : Nil
Sends a JSON-RPC message (Hash serialized to JSON + newline).
-
#send_json(obj : Hash(String, JSON::Any)) : Nil
Convenience: send a JSON::Serializable object that has already been wrapped in the JSON-RPC envelope.
Instance Method Detail
Receives the next incoming JSON message, blocking until one arrives. Returns nil if the transport is closed.
Sends a JSON-RPC message (Hash serialized to JSON + newline).
Convenience: send a JSON::Serializable object that has already been wrapped in the JSON-RPC envelope.