GenServer that manages a single room's state.
Each room has its own process that holds:
- The Room struct
- Bounded message history
- Active participants
Rooms are started on-demand and hibernate after inactivity.
Summary
Functions
Add a message to the room's history
Add or update a participant in the room
Add a reaction to a message
Assign a thread to an agent
Returns a specification to start this module under a supervisor.
Fetch one registered agent
Get list of agent PIDs participating in a room
Get messages from the room's history.
Get all participants in the room
Get the room struct
Get the current room server state
Get currently typing participants
List registered agents
List thread assignments
Mark a message as delivered to a participant
Mark a message as read by a participant
Register an agent with the room
Remove a participant from the room
Remove a reaction from a message
Returns the Zoi schema
Set typing status for a participant
Start a RoomServer for the given room.
Get thread assignment
Unassign a thread
Unregister an agent from the room
Update a participant's presence status
Generate a via tuple for Registry-based process lookup
Check if a room server is running
Types
@type t() :: %Jido.Messaging.RoomServer{ instance_module: any(), message_limit: integer(), messages: [ %Jido.Messaging.Message{ content: term(), delivery_external_room_id: term(), external_id: term(), external_reply_to_id: term(), external_thread_id: term(), id: term(), inserted_at: term(), metadata: term(), reactions: term(), receipts: term(), reply_to_id: term(), role: term(), room_id: term(), sender_id: term(), status: term(), thread_id: term(), updated_at: term() } ], participants: map(), registered_agents: map(), room: %Jido.Chat.Room{ external_bindings: term(), id: term(), inserted_at: term(), metadata: term(), name: term(), type: term() }, thread_assignments: map(), timeout_ms: integer(), typing: map(), typing_timeout_ms: integer() }
Functions
Add a message to the room's history
Add or update a participant in the room
Add a reaction to a message
Assign a thread to an agent
Returns a specification to start this module under a supervisor.
See Supervisor.
Fetch one registered agent
Get list of agent PIDs participating in a room
Get messages from the room's history.
Options:
:limit- Max messages to return (default: all)
Get all participants in the room
Get the room struct
Get the current room server state
Get currently typing participants
List registered agents
List thread assignments
Mark a message as delivered to a participant
Mark a message as read by a participant
Register an agent with the room
Remove a participant from the room
Remove a reaction from a message
Returns the Zoi schema
Set typing status for a participant
Start a RoomServer for the given room.
Options:
:room- Required. The Room struct or room attributes:instance_module- Required. The Jido.Messaging instance module:message_limit- Optional. Max messages to keep (default: 100):timeout_ms- Optional. Inactivity timeout before hibernation (default: 5 min)
Get thread assignment
Unassign a thread
Unregister an agent from the room
Update a participant's presence status
Generate a via tuple for Registry-based process lookup
Check if a room server is running