module Cannon::Rpc::Service(T)

Overview

Creates a Service, which can be passed into a Manager and then used by others through a Connection.

The T is the service description module. All public methods of T will be remotely callable. Please see samples/rpc for a usage example.

Remotely callable methods in T, whose last argument, or only argument, is a Connection, will have the calling Connection injected. The connection argument "disappears" from the client-side.

A Service can only be registered to a single Manager.

Included Modules

Defined in:

cannon/rpc/service.cr

Instance methods inherited from module Cannon::Rpc::GenericService

manager : Manager | Nil manager, manager=(manager : Manager | Nil) manager=, manager? : Manager | Nil | Nil manager?, owner : Connection | Nil owner, owner=(owner : Connection | Nil) owner=, rpc_invoke(function_hash : UInt32, io, connection : Connection) : ResponseWriter rpc_invoke, rpc_invoke_async(function_hash : UInt32, io, connection : Connection) : Tuple(Channel(ResponseWriter), Channel(Exception)) rpc_invoke_async, service_id : UInt32 | Nil service_id, service_id=(service_id : UInt32 | Nil) service_id=, service_id? : UInt32 | Nil | Nil service_id?