UniqueApp
- class omni.structuredlog.UniqueApp
Bases:
pybind11_object
Helper class to manage the unique telemetry transmitter instance on the system. This can be used to ‘connect’ to the transmitter as a client which will prevent it from shutting down until your client has exited or disconnected.
Launching a transmitter through launchTransmitter() will create this guard already, so using a guard manually is only necessary in cases where that’s not being used, such as tests.
Methods
__init__
(*args, **kwargs)connect_client_process
(self)Notifies the unique app that a host app is running.
'Disconnect' the calling process from the exit guard.
- __init__(*args, **kwargs)
- connect_client_process(self: omni.structuredlog._structuredlog.UniqueApp) bool
Notifies the unique app that a host app is running.
This lets the unique app know that the calling host app is still running. This is done by adding a shared lock reference to a marker file that the unique app can poll on periodically. The operating system will automatically remove the lock reference(s) for this call once the calling process exits (naturally or otherwise).
This call is not thread safe. It is the caller’s responsibility to ensure calls to it are protected. However, since it is meant to operate between processes, there may still be unavoidable race conditions that could arise.
- Returns
- `true` if the unique app was successfully notified of the new running
host app. Returns `false` if the notification either couldn’t be sent or could not be completed.
- disconnect_client_process(self: omni.structuredlog._structuredlog.UniqueApp) None
‘Disconnect’ the calling process from the exit guard.
This closes the calling process’s reference to the exit guard file. This will allow the exit guard for a host app process to be explicitly cleaned up before exit if needed.
This call is not thread safe. It is the caller’s responsibility to ensure calls to it are protected.
- Returns
None