Live Session Management#

High-level Live Session operations that work across all storage backends (Nucleus, S3, Azure, HTTP). These functions provide session, layer, and user management for real-time collaboration. Live layer URLs are derived client-side by appending the layer name to the session URL: liveLayerUrl = sessionUrl + "/" + liveLayerName.

Enumerations Summary#

OmniClientLiveSessionEventType

Live session event types.

Functions Summary#

OmniClientRequestId omniClientLiveCreateSession(const char *baseLayerUrl, const char *sessionName, void *userData, OmniClientLiveCreateSessionCallback callback)

Create a new Live Session.

OmniClientRequestId omniClientLiveJoinSession(const char *sessionUrl, const char *appName, void *userData, OmniClientJoinLiveSessionCallback eventCallback)

Join a session to receive user presence events.

OmniClientRequestId omniClientLiveListSessions(const char *baseLayerUrl, void *userData, OmniClientLiveListSessionsCallback callback)

List all Live Sessions for a base layer.

OmniClientRequestId omniClientLiveSendMessage(OmniClientRequestId sessionId, struct OmniClientContent *content, void *userData, OmniClientLiveSendMessageCallback callback)

Send a message to all users in a session.

Structs Summary#

OmniClientLiveSessionEvent

Live session event structure.

OmniClientLiveSessionInfo

Information about a Live Session.

OmniClientLiveUserInfo

Information about a user in a Live Session.

Typedefs Summary#

Enumerations#

enum OmniClientLiveSessionEventType#

Live session event types.

Values:

enumerator eOmniClientLiveSessionEvent_Connection#

Connected or disconnected (depending on result code)

enumerator eOmniClientLiveSessionEvent_Joined#

A user joined the session.

enumerator eOmniClientLiveSessionEvent_Left#

A user left the session.

enumerator eOmniClientLiveSessionEvent_Message#

A user sent a message.

Functions#

OmniClientRequestId omniClientLiveCreateSession(
const char *baseLayerUrl,
const char *sessionName,
void *userData,
OmniClientLiveCreateSessionCallback callback,
)#

Create a new Live Session.

Creates a new live session for collaborative editing of a USD layer. The session URL is assigned by the system and may be predictable (Nucleus) or unpredictable (Storage API backends).

Parameters:
  • baseLayerUrl – URL of the base USD layer

  • sessionName – User-defined session name (must be unique per base layer)

  • userData – User data passed to callback

  • callback – Called with the created session URL

Returns:

Request ID that can be used with omniClientStop

OmniClientRequestId omniClientLiveJoinSession(
const char *sessionUrl,
const char *appName,
void *userData,
OmniClientJoinLiveSessionCallback eventCallback,
)#

Join a session to receive user presence events.

The first event delivered to eventCallback will be eOmniClientLiveSessionEvent_Connection containing this client’s connection ID, which is needed for tagging user-specific objects in the scene (e.g., avatars).

If the underlying stream is reset (e.g. by an ingress controller), it is re-established transparently. A new eOmniClientLiveSessionEvent_Connection event is delivered with a potentially different connection ID. The peer list is diffed: peers present before and after the reconnect produce no additional Joined/Left events; only genuinely new or departed peers trigger callbacks.

To leave the session, call omniClientStop with the returned session ID.

Parameters:
  • sessionUrl – Session URL

  • appName – Application name to identify this client

  • userData – User data passed to callback

  • eventCallback – Called for user events (ack/joined/left/message)

Returns:

Session ID (use for leaving via omniClientStop and for omniClientLiveSendMessage)

OmniClientRequestId omniClientLiveListSessions(
const char *baseLayerUrl,
void *userData,
OmniClientLiveListSessionsCallback callback,
)#

List all Live Sessions for a base layer.

This is a simple request/response operation. To detect session changes, poll this function periodically (e.g., every 5-10 seconds).

Parameters:
  • baseLayerUrl – URL of the base USD layer

  • userData – User data passed to callback

  • callback – Called with list of sessions

Returns:

Request ID that can be used with omniClientStop

OmniClientRequestId omniClientLiveSendMessage(
OmniClientRequestId sessionId,
struct OmniClientContent *content,
void *userData,
OmniClientLiveSendMessageCallback callback,
)#

Send a message to all users in a session.

You must have called omniClientLiveJoinSession first and use the returned session ID.

Parameters:
  • sessionId – Session ID from omniClientLiveJoinSession

  • content – The message content to send (ownership is transferred)

  • userData – User data passed to callback

  • callback – Called when send is complete

Returns:

Request ID that can be used with omniClientStop

Typedefs#

typedef void (*OmniClientJoinLiveSessionCallback)(void *userData, OmniClientResult result, OmniClientLiveSessionEvent const *event)#

Called when a live session event occurs.

Param userData:

User data passed to the function

Param result:

Result code indicating success or failure

Param event:

Live session event information

typedef void (*OmniClientLiveCreateSessionCallback)(void *userData, OmniClientResult result, const char *sessionUrl)#

Called with the result of omniClientLiveCreateSession.

Param userData:

User data passed to the function

Param result:

Result code indicating success or failure

Param sessionUrl:

System-assigned session URL (null if failed)

typedef void (*OmniClientLiveListSessionsCallback)(void *userData, OmniClientResult result, uint32_t sessionCount, OmniClientLiveSessionInfo const *sessions)#

Called with the result of omniClientLiveListSessions.

Param userData:

User data passed to the function

Param result:

Result code indicating success or failure

Param sessionCount:

Number of sessions in the sessions array

Param sessions:

Array of session information structures

typedef void (*OmniClientLiveSendMessageCallback)(void *userData, OmniClientResult result)#

Called with the result of omniClientLiveSendMessage.

Param userData:

User data passed to the originating function

Param result:

The result of the operation