GisilaRose class
A Flower-equivalent observability (and control) dashboard for gisila_queue.
It binds a MonitorState to an EventSource (the live event stream produced by workers/producers) and serves:
GET /— a self-contained HTML dashboard (auto-refreshing, live tail).GET /api/stats— summary counters, worker/queue rollups, capabilities.GET /api/workers— per-worker status + counters + active task ids.GET /api/workers/<id>— one worker plus its recent tasks.GET /api/tasks— recent tasks (filter bystate/name/queue/worker, paginate withlimit/offset).GET /api/tasks/<id>— one task's full detail.POST /api/tasks/fire— enqueue a new task by name/args/kwargs/queue.POST /api/tasks/<id>/retry— re-fire a historical task (new id).POST /api/tasks/<id>/revoke— broadcast revoke via control.POST /api/queues/<name>/pause/.../resume— pause/resume consumption.GET /api/queues— broker depth per known queue.GET /api/events— Server-Sent Events firehose for live updates.
Optional basicAuth ("user:pass") gates every route with HTTP Basic Auth.
Mutating endpoints require broker (fire/retry) and/or control
(revoke/pause/resume); otherwise they return 503.
Run it as its own process (see bin/rose.dart) pointed at the same Redis
the cluster uses, or embed it in-process with an InMemoryEventBus.
final rose = GisilaRose(
source: RedisEventSource(host: 'localhost'),
broker: RedisBroker(host: 'localhost'),
control: RedisControlChannel(host: 'localhost'),
events: RedisEventSink(host: 'localhost'),
basicAuth: 'admin:secret',
port: 5555,
);
await rose.start();
Constructors
- GisilaRose({required QueueEventSource source, Broker? broker, ControlChannel? control, QueueEventSink? events, ResultBackend? backend, String? basicAuth, MonitorState? state, String host = '0.0.0.0', int port = 5555, Duration queuePollInterval = const Duration(seconds: 2), Uuid? idGenerator})
Properties
- backend → ResultBackend?
-
Optional result backend — stores a pending result when Rose enqueues.
final
- basicAuth → String?
-
When set (
"user:pass"), every HTTP route requires Basic Auth.final - boundPort → int?
-
The actual port bound after start — useful when port was
0(bind to any free port), e.g. in tests. Null before start / after stop.no setter - broker → Broker?
-
Optional broker used to poll queue depths and to enqueue on fire/retry.
final
- control → ControlChannel?
-
Optional control channel for revoke / pause / resume.
final
- events → QueueEventSink?
-
Optional sink used to emit
taskSentwhen Rose fires or retries a task.final - hashCode → int
-
The hash code for this object.
no setterinherited
- host → String
-
final
- port → int
-
final
- queuePollInterval → Duration
-
How often broker queue depths are refreshed.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- source → QueueEventSource
-
The live event stream the dashboard folds into state.
final
- state → MonitorState
-
final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
pollQueuesNow(
) → Future< void> - Refreshes MonitorState.queueLengths immediately instead of waiting for the next queuePollInterval tick — mainly useful in tests.
-
start(
) → Future< void> - Binds the event source, starts queue polling, and begins serving. Resolves once the server is listening.
-
stop(
) → Future< void> - Stops serving and releases the event source / broker / control connections.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited