pub trait RuleSwapBackend: Send + Sync {
// Required methods
fn pre_stage(&self, rule: &CompiledRule) -> Result<(), RuleError>;
fn quiesce(&self, rule_id: &str, version: u64) -> Result<u64, RuleError>;
fn swap(&self, rule_id: &str, new_version: u64) -> Result<(), RuleError>;
fn terminate_old(
&self,
rule_id: &str,
old_version: u64,
) -> Result<(), RuleError>;
}Expand description
Pluggable GPU-side swap backend.
The registry is hardware-agnostic; concrete backends drive actual CUDA module loading, actor quiescing, and atomic pointer swaps.
Default implementation is NoopSwapBackend — it returns success
instantly for every method, which is useful for unit tests and for
the v1.1 pre-hardware development phase.
Required Methods§
Sourcefn pre_stage(&self, rule: &CompiledRule) -> Result<(), RuleError>
fn pre_stage(&self, rule: &CompiledRule) -> Result<(), RuleError>
Pre-stage a rule artifact on the device (e.g. load the PTX into a
CUDA module but do not yet make it the active actor). Called
before quiesce.
Sourcefn quiesce(&self, rule_id: &str, version: u64) -> Result<u64, RuleError>
fn quiesce(&self, rule_id: &str, version: u64) -> Result<u64, RuleError>
Quiesce the old actor. Returns the count of messages drained.
Called only for reload / rollback, not for register.