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.

Implementation

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