Skip to main content

Module task

Module task 

Source

Structs§

BlockingBridge
A capability, captured where the backend’s executor is reachable, to run async work from a plain blocking thread (iocsh, a REPL, a script thread).
Elapsed
The timeout’s error — “the deadline elapsed before the future completed”. Hosted this is tokio’s own type so timeout composes with tokio-aware callers; the exec backend substitutes a mirror (same Decision-B alias pattern as TaskJoinError — the consumed surface is Debug/Display only). Errors returned by Timeout.
Interval
Periodic ticker — the seam replacement for tokio::time::interval, so no production site names tokio::time directly (decision A2). The hosted build wraps tokio::time::Interval, preserving its default MissedTickBehavior::Burst catch-up and immediate first tick; the RTEMS build substitutes the runtime-free crate::runtime::background::timer_sleep::TimerInterval, which reproduces the same semantics over the delayed-callback timer.
MandatoryThread
A thread the IOC cannot correctly run without — the scan rates, the callback bands, the delayed-callback timer, the boot script.
RuntimeHandle
Handle to the runtime.
TaskSet
A set of spawned tasks, joined as they complete — the seam replacement for tokio::task::JoinSet.

Enums§

NotBlockable
A synchronous caller asked to block on an async operation from a thread where blocking cannot be made sound.
PriorityApplied
Outcome of a best-effort OS-scheduler priority change.
RtPolicy
Whether this process may ask the OS for real-time scheduling.
StackSizeClass
Stack-size class — epicsThreadStackSizeClass (epicsThread.h:91).
ThreadPriority
EPICS thread priority — an integer 0..=99 with the named levels from epicsThreadPriority* (epicsThread.h:73-83). Lower values are lower priority; the CA server bands sit below the scan bands so scan threads preempt CA-server threads on a loaded IOC.

Constants§

DEFAULT_POLICY
What RT_PRIORITY_ENV means when it is unset, for the target this was compiled for.
HAS_TOKIO_REACTOR
true when spawn lands the future on the tokio runtime, false when it lands on the reactor-free background executor (exec_backend — the RTEMS target, or a host build with --features rtems-exec-model).
PRIORITY_MAX
Maximum EPICS thread priority (epicsThreadPriorityMax).
PRIORITY_MIN
Minimum EPICS thread priority (epicsThreadPriorityMin).
RT_PRIORITY_ENV
Environment switch that opts this process in to real-time (SCHED_FIFO) scheduling for the IOC threads that carry an EPICS priority.

Functions§

apply_to_current_thread
Apply an EPICS ThreadPriority to the current OS thread, best effort.
apply_to_current_thread_under
apply_to_current_thread with the real-time policy supplied by the caller instead of read from the environment.
block_on_sync
Block the calling thread on fut, picking the mechanism that is sound for the thread we are actually on.
enter_ioc_thread
The prologue an IOC thread runs as its first statement, when it takes on its role: publish its name to the OS, then request its scheduling band.
interval
Build a periodic ticker firing every period — the seam replacement for tokio::time::interval.
name_current_thread
Push std::thread::current().name() down to the OS thread object.
runtime_handle
sched_calls_made
How many times this process has asked the OS scheduler for SCHED_FIFO, across every thread — including the one-off range probe.
sleep
sleep_until
spawn
spawn_blocking
spawn_blocking_with_priority
Spawn a blocking closure on a dedicated thread and apply the given EPICS ThreadPriority to that thread before running f.
spawn_dedicated_thread
Spawn a dedicated OS thread that runs f at priority with a stack of StackSizeClass, plus whatever ambient async context block_on_sync needs on this target.
test_block_on
Drive an async test body to completion — the driver behind #[epics_test] (epics-macros-rs).
timeout
Await fut, giving up after duration — the seam’s only bounded wait.
timeout_at
timeout against an absolute Instant instead of a duration — the seam’s tokio::time::timeout_at.
yield_now
Yield the current task once — the seam replacement for tokio::task::yield_now, so no call site names tokio::task directly.

Type Aliases§

Instant
The instant sleep_until measures deadlines against — the backend’s own clock, which is the whole point of naming it here.
TaskAbortHandle
Detached cancellation handle for a spawned task.
TaskHandle
Handle to a spawned task — await for its result, abort() to cancel.
TaskJoinError
Error from awaiting a TaskHandle (cancelled or panicked).