waitForRequestWithTimeout#

Fully qualified name: isaacsim::ucx::core::waitForRequestWithTimeout

UcxRequestWaitResult isaacsim::ucx::core::waitForRequestWithTimeout(
std::shared_ptr<ucxx::Request> request,
uint32_t timeoutMs,
std::string &errorMessage,
uint32_t pollIntervalUs = 1000,
)#

Wait for a UCX request to complete with timeout.

Polls the request status until it completes, fails, or the timeout expires. Only g_kUcxInfiniteTimeout (UINT32_MAX) waits indefinitely. A timeout of 0 means “do not wait”: the request is polled exactly once and cancelled if it has not already completed. An unbounded wait can never be interrupted from another thread, so callers that run on an application update thread must not request one.

The function uses a configurable polling interval which provides a balance between responsiveness and CPU usage. The default interval (1ms) is suitable for most real-time simulation scenarios.

Note

This function is thread-safe if the UCX request object is thread-safe.

Warning

Polling with very short intervals may consume significant CPU when multiple nodes are polling simultaneously. Consider using intervals >= 1000μs (1ms) for non-critical operations.

Parameters:
  • request – [in] UCX request to wait for (must not be null)

  • timeoutMs – [in] Timeout in milliseconds (0 = poll once without waiting, g_kUcxInfiniteTimeout = infinite wait)

  • errorMessage – [out] String for storing error messages from checkError()

  • pollIntervalUs – [in] Polling interval in microseconds (default: 1000)

Returns:

UcxRequestWaitResult indicating the outcome:

  • eCompleted: Request finished successfully (UCS_OK)

  • eTimedOut: Timeout expired before completion (request is cancelled)

  • eFailed: Null request or UCX error status (not UCS_OK or UCS_INPROGRESS)