pub async fn handle_events<F, R, E>(
db: Database,
tracker: DynEventLogTracker,
log_event_added: Receiver<()>,
call_fn: F,
) -> Result<(), EventHandlerError<E>>where
F: Fn(&mut DatabaseTransaction<'_, NonCommittable>, EventLogEntry) -> R,
R: Future<Output = Result<(), E>>,
E: Error + 'static,Expand description
Feeds every entry of the event log, past and future, to call_fn.
tracker remembers how far the log has been read so a restart resumes where
it left off; the loop stops when call_fn fails or the client shuts down.