Class PlatformDispatcher::Submission

Nested Relationships

This class is a nested type of Class PlatformDispatcher.

Class Documentation

class Submission

Declaration: final

Copyable submission endpoint, with no borrowed dispatcher or engine pointer.

Queueing always defers execution, including submissions from the owner thread. Rejection throws failed_operation; accepted callback failures reach their future. Submission is thread-safe while the endpoint remains alive. Own callable captures through execution/cancellation; reference captures/results remain the caller’s lifetime responsibility. Do not wait from the execution owner.

Public Functions

template<typename Work>
inline std::future<std::invoke_result_t<std::decay_t<Work>&, Context&>> submit(Work &&work) const

Declaration: [[nodiscard]]

Queue an owned callable for deferred platform-owner execution.

See also

Detailed guide

Template Parameters:

Work – Callable invocable with Runtime::Context&; move-only captures and void/value/reference results are supported.

Parameters:

work – Callable forwarded into owned queue storage; borrowed captures/results remain the caller’s lifetime responsibility.

Throws:

CE::Exceptions::failed_operation – If no active accepting runtime queue exists. Allocation/callable construction failures can propagate before acceptance. Always queues, even from the owner thread. Do not wait on this future from the execution owner. Capture immutable values/owned CPU data; do not access live simulation objects from this callback.

Returns:

Future holding the invocation result or its exception; cancellation before entry produces broken_promise.