class Cannon::Rpc::NullConnection

Defined in:

cannon/rpc/connection.cr

Constant Summary

INSTANCE = new(Manager.new)

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) #
Description copied from class Cannon::Rpc::Connection

Like #call_remotely, but doesn't request a response. A response is never requested and thus is never received.

Note: This will also silence any error propagation from the remote side back to the local side.

This method does not block the current 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]