FakeEventBus class final

Event bus of the fake: seq numbering, ring buffer, fan-out to sessions.

Constructors

FakeEventBus({int capacity = 10000})
Creates a bus keeping the last capacity events.

Properties

alias ↔ String? Function(String topic)?
Alias of a topic (the fake maps venues/<active id>/… → venues/default/…): every event published on a topic with an alias is published once more on the alias, so subscribers of either form see it.
getter/setter pair
capacity → int
Ring-buffer size.
final
hashCode → int
The hash code for this object.
no setterinherited
history → List<FreedomeEvent>
Events in the ring buffer.
no setter
oldestSeq → int?
Oldest seq still replayable (null when empty).
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
seq → int
Last assigned seq.
no setter
sessions → List<FakeSession>
Sessions currently open.
no setter

Methods

closeAll([int code = 1001, String reason = 'going away']) → Future<void>
Closes every session with code (e.g. 1006-like drop, 1012 restart).
forgetBefore(int seq) → void
Drops the oldest events so that resuming before seq is impossible (forces resync).
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
publish(String topic, String kind, {Object? resource, Map<String, Object?>? patch, int? revision}) → FreedomeEvent
Publishes an event (full resource or merge patch).
restartEpoch() → void
Server restart: seq restarts at 0 and the buffer is emptied (clients see a new epoch).
toString() → String
A string representation of this object.
inherited

Operators

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