listen abstract method

StreamSubscription<AmqpMessage> listen(
  1. void onData(
    1. AmqpMessage event
    ), {
  2. Function? onError,
  3. void onDone()?,
  4. bool? cancelOnError,

Bind onData listener to the stream of AmqpMessage that is emitted by the consumer.

You can also define an optional onError method that will handle stream errors and an onDone method to be invoked when the stream closes.


StreamSubscription<AmqpMessage> listen(void onData(AmqpMessage event),
    {Function? onError, void onDone()?, bool? cancelOnError});