View Source Teiserver.Connections (Teiserver v0.0.3)
The context for all things connection related, mostly Teiserver.Connections.Client
Clients
Clients are represented by a process holding their state, this process controls all updates to their state.
Creating a client
Clients are created using connect_user/1
, this will create (if it doesn't already exist) a client process. Any process connecting a user will be subscribed to the Teiserver.ClientUpdates:{user_id}
channel.
Destroying clients
TODO: Implement and document
Summary
Clients
@spec client_exists?(Teiserver.user_id()) :: pid() | boolean()
@spec connect_user(Teiserver.user_id()) :: Teiserver.Connections.Client.t()
@spec get_client(Teiserver.user_id()) :: Teiserver.Connections.Client.t() | nil
@spec list_client_ids() :: [Teiserver.user_id()]
@spec update_client(Teiserver.user_id(), map()) :: Teiserver.Connections.Client.t() | nil