InMemoryScheduleStore class
Simple in-memory schedule store implementation used in tests.
The store maintains a map of IDs to _ScheduleState objects. It uses
ScheduleCalculator to automatically compute future run times during
upserts and execution marking.
Concurrency Control
This implementation uses optimistic concurrency control via the version
property on ScheduleEntry. If a version mismatch is detected during
upsert, a ScheduleConflictException is thrown.
- Implemented types
Constructors
- InMemoryScheduleStore({ScheduleCalculator? calculator})
- Creates an in-memory schedule store.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
due(
DateTime now, {int limit = 100}) → Future< List< ScheduleEntry> > -
Returns schedules that should run at or before
now.override -
get(
String id) → Future< ScheduleEntry?> -
Retrieves the schedule entry with
id, or null if absent.override -
list(
{int? limit}) → Future< List< ScheduleEntry> > -
Lists schedule entries ordered by next run time.
override
-
markExecuted(
String id, {required DateTime scheduledFor, required DateTime executedAt, Duration? jitter, String? lastError, bool success = true, Duration? runDuration, DateTime? nextRunAt, Duration? drift}) → Future< void> -
Updates execution metadata for the entry
id.override -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
remove(
String id) → Future< void> -
Removes the schedule entry with the given
id.override -
toString(
) → String -
A string representation of this object.
inherited
-
upsert(
ScheduleEntry entry) → Future< void> -
Inserts or updates a schedule entry, recomputing its next run.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited