GroupHandlerService

io.github.positionpal.services.GroupHandlerService
trait GroupHandlerService[F[_], T]

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
class GroupService

Members list

Value members

Abstract methods

def connect(groupID: String)(clientID: ClientID, channel: ActorRef[T]): F[ClientID]

Connect a client to the group. Note that the client must be a member of the group, therefore, GroupHandlerService.join should be called first.

Connect a client to the group. Note that the client must be a member of the group, therefore, GroupHandlerService.join should be called first.

Value parameters

channel

An ActorRef that communicates directly with the client

clientID

The ID of the client that should be connected

groupID

The ID of the group of the client

Attributes

Returns

A Future with the ClientID that connected to the group

def delete(groupID: String): F[Unit]

Delete the group

Delete the group

Value parameters

groupID

The ID of the group to delete

Attributes

Returns

A F representing the completion of the operation

def disconnect(groupID: String)(clientID: ClientID): F[ClientID]

Disconnects a client from the group. Note that the client must be a member of the group, therefore, GroupHandlerService.join should be called first.

Disconnects a client from the group. Note that the client must be a member of the group, therefore, GroupHandlerService.join should be called first.

Value parameters

clientID

The ID of the client that should be connected

groupID

The ID of the group of the client

Attributes

Returns

A Future with the ClientID that have disconnected from the group

def join(groupID: String)(clientID: ClientID): F[List[ClientID]]

Join a client to a specific group

Join a client to a specific group

Value parameters

clientID

The ID of the client joining

groupID

The ID of the group to join

Attributes

Returns

A F with List of ClientID that are currently connected to the service

def leave(groupID: String)(clientID: ClientID): F[ClientID]

Remove a client to a specific group

Remove a client to a specific group

Value parameters

clientID

The ID of the client that should be removed

groupID

The ID of the group to join

Attributes

Returns

A Future with the ClientID that left the group

def message(groupID: String)(message: Message[ClientID, String]): F[Unit]

Send a message in a group. All client in connected status will receive this.

Send a message in a group. All client in connected status will receive this.

Value parameters

groupID

The ID of the group of the client

message

The message that should be broadcast

Attributes

Returns

A Future wit the ClientID that have disconnected from the group