class Cannon::Rpc::Manager

Overview

Manages local Service instances, which are then offered through Connections.

Defined in:

cannon/rpc/manager.cr

Constructors

Instance Method Summary

Class methods inherited from class Object

to_cannon_io(io, value) to_cannon_io

Constructor Detail

def self.new #

[View source]

Instance Method Detail

def [](*args, **options) #

[View source]
def [](*args, **options, &) #

[View source]
def []?(*args, **options) #

[View source]
def []?(*args, **options, &) #

[View source]
def add(service : GenericService, owner : Connection | Nil = nil, id : UInt32 | Nil = nil) : UInt32 #

Adds a locally running service for owner to the manager. If owner is not nil, the service is said to be owned by that connection, and (only) this connection shall be allowed to release it (remove it) later on again. If you don't need or want this behaviour for a service, simply pass nil. If no id is given, a unused one will be chosen automatically. If the service is a SingletonService, the id will be set to the assigned id in this case. If a id is given, it will be used, and may override an already existing service.


[View source]
def has_service?(service_id : UInt32) : Bool #

[View source]
def release(service : GenericService) #

Releases service.


[View source]
def release(service_id : UInt32, owner : Connection | Nil = nil) #

Releases the service service_id of owner. If the owner does not match, an Error is raised.


[View source]
def release_all_services(owner : Connection) : Nil #

Releases all services of owner.


[View source]
def services : Hash(UInt32, GenericService) #

[View source]
def services=(services : Hash(UInt32, GenericService)) #

[View source]