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.cr

Instance Method Summary

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

def call_remotely(service_id : UInt32, function_hash : UInt32, arguments : Tuple | Nil, &block : IO -> _) #
Description copied from class Cannon::Rpc::Connection

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.


[View source]
def call_remotely(service_id : UInt32, function_hash : UInt32, arguments : Tuple | Nil) #

No-result version, runs concurrently in a background fiber.


[View source]
def release_remote_service(service_id : UInt32) #
Description copied from class Cannon::Rpc::Connection

Releases the remote service_id


[View source]
def run #
Description copied from class Cannon::Rpc::Connection

Starts a read-loop, blocking the current Fiber.


[View source]