Extension: omni.kit.collaboration.channel_manager-1.2.0 |
Documentation Generated: Aug 27, 2026 |
Introduction#
Extension omni.kit.collaboration.channel_manager provides interfaces for managing live session communication channels. It uses the OmniClient Live Session API to handle user presence (join/leave detection) and message exchange between clients in the same session.
How It Works#
The channel manager wraps omni.client.live_join_session_with_callback, which provides server-managed user presence tracking. The server delivers typed events:
Connection: Delivered first upon joining, contains this client’s unique
connection_id.Joined: A user joined the session. Includes
connection_id,user_name, andapp_name.Left: A user left the session (or was detected as disconnected by the server).
Message: A user sent an application-specific message.
The server automatically detects disconnected users and delivers Left events for them.
get_users_only Mode#
When get_users_only=True, the client joins with a blank app_name. Clients will hide peers with a blank app_name from the user list. This allows discovering session participants without announcing presence.
Programming Guide#
Here is an async function that joins a session and sends a message to all participants.
import omni.kit.collaboration.channel_manager as cm
async def join_session(session_url, on_message: Callable[[cm.Message], None]):
channel = await cm.join_channel_async(session_url)
if channel:
channel.add_subscriber(on_message)
await channel.send_message_async({"test": "hello world"})
The first step is to join a session with omni.kit.collaboration.channel_manager.join_channel_async(), which returns a handle through which you can query connection state, other users, and send messages (see omni.kit.collaboration.channel_manager.Channel.send_message_async()). Use omni.kit.collaboration.channel_manager.Channel.add_subscriber() to subscribe to messages. Messages are of type omni.kit.collaboration.channel_manager.Message with the following types (see omni.kit.collaboration.channel_manager.MessageType):
JOIN: A user joined this session.LEFT: A user left the session or was detected as disconnected.MESSAGE: Application-specific message sent throughomni.kit.collaboration.channel_manager.Channel.send_message_async().ERROR: The underlying connection is broken.