dispatch method
Shared dispatch path for monitor events: always notifies listener, and
persists record to ArgosPacketStorage when storage is enabled.
Implementation
void dispatch(ArgosBaseModel model, {ArgosPacketRecord? record}) {
if (listener != null) {
listener!(model);
}
if ((config?.enableStorage ?? false) && record != null) {
ArgosPacketStorage.instance.appendRecord(
record,
maxRecords: config?.maxPacketRecords ?? 200,
resourceMaxRecords: config?.resourceMaxRecords ?? 50,
);
}
}