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).
Instance Method Detail
abstract
def receive : JSON::Any | Nil
#
Receives the next incoming JSON message, blocking until one arrives. Returns nil if the transport is closed.
abstract
def send(message : Hash(String, JSON::Any)) : Nil
#
Sends a JSON-RPC message (Hash serialized to JSON + newline).