Channel#

class omni.kit.collaboration.channel_manager.Channel(
handler: <module 'weakref' from '/builds/omniverse/kit/kit/_build/python/lib/python3.12/weakref.py'>,
channel_manager: <module 'weakref' from '/builds/omniverse/kit/kit/_build/python/lib/python3.12/weakref.py'>,
)#

Bases: object

Channel represents the instance of a live session channel.

Methods

__init__(handler, channel_manager)

Internal constructor.

add_subscriber(on_message)

Add subscriber.

send_message_async(content)

Async function.

stop()

Attributes

local_connection_id

The connection ID assigned to this client by the server.

logged_user_id

[Deprecated] The logged-in user identifier for this channel.

logged_user_name

[Deprecated] The logged-in user name for this channel.

peer_users

All the peer clients that joined to this channel.

stopped

Whether channel is stopped or not.

url

__init__(
handler: <module 'weakref' from '/builds/omniverse/kit/kit/_build/python/lib/python3.12/weakref.py'>,
channel_manager: <module 'weakref' from '/builds/omniverse/kit/kit/_build/python/lib/python3.12/weakref.py'>,
) None#

Internal constructor.

add_subscriber(
on_message: Callable[[Message], None],
) ChannelSubscriber#

Add subscriber.

Parameters:

on_message (Callable[[Message], None]) – The message handler.

Returns:

Instance of ChannelSubscriber. The channel will be stopped if instance is release. So it needs to hold the instance before it’s stopped. You can manually call `stop` to stop this channel, or set the returned instance to None.

async send_message_async(
content: dict,
) Result#

Async function. Send message to all peer clients.

Parameters:

content (dict) – The message composed in dictionary.

Returns:

omni.client.Result.

property local_connection_id#

The connection ID assigned to this client by the server.

property logged_user_id: str#

[Deprecated] The logged-in user identifier for this channel.

Retained for API compatibility with the v2 surface. Forwards to local_connection_id, the closest analogue in the new omniclient-backed model.

property logged_user_name: str#

[Deprecated] The logged-in user name for this channel.

Retained for API compatibility with the v2 surface; always returns “”.

property peer_users: Dict[str, PeerUser]#

All the peer clients that joined to this channel.

property stopped#

Whether channel is stopped or not.