class Cannon::Rpc::Manager
- Cannon::Rpc::Manager
- Reference
- Object
Overview
Manages local Service
instances, which are then offered through
Connection
s.
Defined in:
cannon/rpc/manager.crConstructors
Instance Method Summary
- #[](*args, **options)
- #[](*args, **options, &)
- #[]?(*args, **options)
- #[]?(*args, **options, &)
-
#add(service : GenericService, owner : Connection | Nil = nil, id : UInt32 | Nil = nil) : UInt32
Adds a locally running service for owner to the manager.
- #has_service?(service_id : UInt32) : Bool
-
#release(service : GenericService)
Releases service.
-
#release(service_id : UInt32, owner : Connection | Nil = nil)
Releases the service service_id of owner.
-
#release_all_services(owner : Connection) : Nil
Releases all services of owner.
- #services : Hash(UInt32, GenericService)
- #services=(services : Hash(UInt32, GenericService))
Class methods inherited from class Object
to_cannon_io(io, value)
to_cannon_io
Constructor Detail
Instance Method Detail
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.
Releases the service service_id of owner. If the owner does not
match, an Error
is raised.