EventSourcePublisher constructor
EventSourcePublisher({})
Create a new EventSource server.
When using a cache, for efficient replaying, it is advisable to use a
custom Event implementation that overrides the Event.compareTo
method.
F.e. if integer events are used, sorting should be done on integers and
not on the string representations of them.
If your Event's id properties are not incremental using
Comparable.compare, set comparableIds
to false.
Implementation
EventSourcePublisher({
int cacheCapacity: 0,
bool comparableIds: false,
bool enableLogging: true,
}) {
if (cacheCapacity > 0) {
_cache = new EventCache(cacheCapacity: cacheCapacity);
}
if (enableLogging) {
logger = new log.Logger("EventSourceServer");
}
}