MonitorState class

Aggregates the QueueEvent stream into a live, queryable model of tasks, workers, and counters — the in-memory state a GisilaRose dashboard renders. This is the gisila_queue analogue of Flower's event-driven state.

Task history is bounded to maxTasks (newest retained), so a long-running monitor stays memory-stable.

Constructors

MonitorState({int maxTasks = 10000, Duration workerTimeout = const Duration(seconds: 30)})

Properties

failed ↔ int
getter/setter pair
hashCode → int
The hash code for this object.
no setterinherited
maxTasks → int
Upper bound on retained tasks; oldest are evicted past this.
final
queueLengths → Map<String, int>
Latest known broker depth per queue, refreshed by the dashboard poller.
final
rateLimited ↔ int
getter/setter pair
received ↔ int
getter/setter pair
retried ↔ int
getter/setter pair
revoked ↔ int
getter/setter pair
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
sent ↔ int
Lifetime totals keyed by QueueEventType.name of terminal/queue events.
getter/setter pair
succeeded ↔ int
getter/setter pair
tap → Stream<QueueEvent>
A re-broadcast of every applied event, for the dashboard's SSE tail.
no setter
taskCount → int
no setter
workers → List<WorkerInfo>
no setter
workerTimeout → Duration
How long after its last heartbeat a worker is considered offline.
final

Methods

activeTaskIdsFor(String workerId) → List<String>
Ids of tasks currently TaskState.started (or just TaskState.pending after TaskInfo.receivedAt) on workerId.
apply(QueueEvent event, {bool broadcast = true}) → void
Folds a single event into the model. broadcast is false during history replay so the SSE tap only carries live events.
bind(QueueEventSource source) → Future<void>
Folds prior history then subscribes to live QueueEventSource.events.
close() → Future<void>
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
stats(DateTime now, {Map<String, Object?>? capabilities}) → Map<String, Object?>
Dashboard summary payload.
taskById(String id) → TaskInfo?
tasks({TaskState? state, String? name, String? queue, String? worker, int limit = 200, int offset = 0}) → List<TaskInfo>
Tasks, most-recently-updated first, optionally filtered.
tasksForWorker(String workerId, {TaskState? state}) → List<TaskInfo>
Tasks associated with workerId, most-recently-updated first.
taskTypeStats() → Map<String, Map<String, int>>
Per-task-name aggregate counts over retained tasks.
toString() → String
A string representation of this object.
inherited
workerById(String id) → WorkerInfo?

Operators

operator ==(Object other) → bool
The equality operator.
inherited