offAck<T extends DataObject> method

void offAck<T extends DataObject>(
  1. MessageHandler<AcknowledgedMessage<T>> handler
)

Removes a handler for when an AcknowledgedMessage of type T is received from a connection.

Implementation

void offAck<T extends DataObject>(
  MessageHandler<AcknowledgedMessage<T>> handler,
) {
  for (final subscription in _ackSubscriptions
      .whereType<StreamSubscription<AcknowledgedMessage<T>>>()) {
    if (subscription.onData == handler) {
      subscription.cancel();
      _ackSubscriptions.remove(subscription);
      break;
    }
  }
}