onData method

void onData(
  1. List<int> event
)

Implementation

void onData(List<int> event) {
  if (_nfut >= 1) {
    Completer c = _queue.removeFirst();
    c.complete(event);
    _nfut -= 1;
  } else {
    Completer<List<int>> c = Completer<List<int>>();
    c.complete(event);
    _queue.addLast(c);
    _npack += 1;
  }
}