pub struct ExecutorBuilder { /* private fields */ }Expand description
Builder for Executor.
Implementations§
Source§impl ExecutorBuilder
impl ExecutorBuilder
Sourcepub const fn worker_threads(self, n: usize) -> Self
pub const fn worker_threads(self, n: usize) -> Self
Number of worker threads. 0 → inline (no pool). Default → physical
cores.
Sourcepub fn observer(self, obs: Arc<dyn Observer>) -> Self
pub fn observer(self, obs: Arc<dyn Observer>) -> Self
Attach a lifecycle observer. If not called, a no-op observer is used.
Sourcepub fn monitor(self, mon: Arc<dyn ExecutionMonitor>) -> Self
pub fn monitor(self, mon: Arc<dyn ExecutionMonitor>) -> Self
Attach an execution monitor. If not called, a no-op monitor is used.
Sourcepub fn worker_attrs(self, attrs: ThreadAttributes) -> Self
pub fn worker_attrs(self, attrs: ThreadAttributes) -> Self
Set thread attributes (name prefix, CPU affinity, scheduling priority)
for worker threads. Has no effect when worker_threads is 0 (inline
mode). Requires the thread_attrs feature for non-default settings.
Sourcepub fn build(self) -> Result<Executor, ExecutorError>
pub fn build(self) -> Result<Executor, ExecutorError>
Build the Executor. Creates a fresh iceoryx2 node and wires up the
internal stop-event service so that any Stoppable clone (taken before
or after run()) will wake the WaitSet when stop() is called.
§Panics
Panics if the internally-generated stop-event service name exceeds the iceoryx2 service name length limit (this cannot happen under normal use because the name is derived from the process id and a monotonic counter).