pub enum LockingHint {
NodeLocal,
RequireGlobal,
PreferGlobal,
}Expand description
Hint to the scheduler about distributed-locking requirements.
Single-node deployments can ignore this field. Multi-node deployments
use it, in combination with a configured crate::locking::LockingPlugin,
to decide which instance fires each schedule.
§How the host uses the hint
The Locking capability shipped in E2 as
crate::locking::LockingPlugin. The host-owned scheduler in
bext-core::scheduler consults this field at each tick:
LockingHint::NodeLocal— skip locking entirely; every node may fire its own copy.LockingHint::RequireGlobal— callLockingPlugin::try_lockkeyed onschedule_idbefore invokingScheduledPlugin::run. OnOk(None)another node holds the lock; skip this tick. OnErr(..)log and skip.LockingHint::PreferGlobal— try the lock as above, but if noLockingPluginis configured fall back toNodeLocalbehavior rather than failing the install.
Performing the acquisition lives in bext-core::scheduler and is
tracked separately from this trait-level doc. The shape, however, is
stable: plugins declare the hint once, the host does the rest.
Variants§
NodeLocal
No coordination needed — every node may fire its own copy. Use for per-node maintenance like local cache GC.
RequireGlobal
The scheduler should hold a cluster-wide lock for the duration of the run. Only one node fires per scheduled tick. Default for most business logic.
PreferGlobal
Best-effort cluster coordination — try to acquire a global lock, fall back to node-local if the Locking capability is not configured. Lets a plugin work correctly in both single-node and multi-node deployments without hard-failing the install.
Trait Implementations§
Source§impl Clone for LockingHint
impl Clone for LockingHint
Source§fn clone(&self) -> LockingHint
fn clone(&self) -> LockingHint
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more