class Cannon::Rpc::LocalConnection
Overview
A process-local connection, useful for debugging and testing. The whole stack is ran through, that is, services, data serialisation, and everything, is used like normal.
Defined in:
cannon/rpc/local_connection.crInstance Method Summary
-
#call_remotely(service_id : UInt32, function_hash : UInt32, arguments : Tuple | Nil, &block : IO -> _)
Calls the function (through function_hash) on service_id using arguments.
-
#call_remotely(service_id : UInt32, function_hash : UInt32, arguments : Tuple | Nil)
No-result version, runs concurrently in a background fiber.
-
#release_remote_service(service_id : UInt32)
Releases the remote service_id
-
#run
Starts a read-loop, blocking the current Fiber.
Instance methods inherited from class Cannon::Rpc::Connection
call_remotely(service_id : UInt32, function_hash : UInt32, arguments : Tuple | Nil, &block : IO -> _)call_remotely(service_id : UInt32, function_hash : UInt32, arguments : Tuple | Nil) call_remotely, close close, manager : Manager manager, on_local_error(&block : Exception -> _) on_local_error, on_remote_error(&block : RemoteError -> _) on_remote_error, release_remote_service(service_id : UInt32) release_remote_service, release_service(service_id : UInt32) release_service, run run, running? : Bool running?
Constructor methods inherited from class Cannon::Rpc::Connection
new(manager : Manager)
new
Class methods inherited from class Object
to_cannon_io(io, value)
to_cannon_io
Instance Method Detail
Calls the function (through function_hash) on service_id using
arguments. Yields an IO
when the response was received and must
be read from it using Cannon.decode
. If a remote error was
encountered, the block is not called, and is raised locally.
This method blocks the current Fiber.
No-result version, runs concurrently in a background fiber.
Releases the remote service_id
Starts a read-loop, blocking the current Fiber.