nack method

Acknowledge that the client has failed processing given events (this will tell the server it has not been processed). Use PersistentSubscriptionNackEventAction to specify which action the server should take. Use String to log a reason.

Implementation

void nack(
  Iterable<ResolvedEvent> events,
  String reason,
  PersistentSubscriptionNackEventAction action,
) {
  final nack = ReadReq_Nack()
    ..reason = reason
    ..action = _toAction(action)
    ..ids.addAll(events.map(
      (e) => (UUID()..string = e.originalEventId.uuid),
    ));
  _requests.add(ReadReq()..nack = nack);
}