pub struct AggregateJobs<M: Memory> { /* private fields */ }Expand description
Durable bounded aggregates in a host-governed allocation. Holds at most 16 jobs, each at most 16 KiB encoded bytes. Creation requires a fresh nonzero incarnation. Handles identify jobs; they do not authorize access. All mutation must run synchronously within one IC message, without awaits. Supplier failures trap; a later message trap rolls these changes back too.
Implementations§
Source§impl<M: Memory> AggregateJobs<M>
impl<M: Memory> AggregateJobs<M>
Sourcepub fn open(memory: RuntimeMemory<M>) -> Result<Self, Error>
pub fn open(memory: RuntimeMemory<M>) -> Result<Self, Error>
Reopen a supported job-store format without modifying it. Version-one jobs remain readable; the first successful insert/save atomically admits version two and its larger frame bound. Older executables then refuse.
§Errors
Refuses missing/corrupt headers and unsupported formats intact.
§Panics
Supplier corruption traps without repair.
Sourcepub fn cancel(&mut self, handle: &JobHandle) -> Result<(), Error>
pub fn cancel(&mut self, handle: &JobHandle) -> Result<(), Error>
Cancel one job, immediately releasing its logical slot. Repeated/stale cancellation refuses; it cannot delete a subsequent occupant of that slot.
§Errors
Refuses a foreign, missing, stale or malformed handle/job frame. Cancellation need not interpret a known frame’s query-specific accumulator payload.
§Panics
Supplier mutation failures trap the enclosing message.
Sourcepub fn cleanup_expired(
&mut self,
now: Timestamp,
limit: usize,
) -> Result<usize, Error>
pub fn cleanup_expired( &mut self, now: Timestamp, limit: usize, ) -> Result<usize, Error>
Examine at most 16 slots and remove at most limit expired jobs (1..=16).
Time must be captured by the host; the database reads no clock. This does
not shrink stable memory or promise physical reclamation by the supplier.
§Errors
Refuses invalid limits or malformed records before removing any job.
§Panics
Supplier mutation failures trap the enclosing message.