execResultHandler method

Future<StreamedResults> execResultHandler(
  1. HandlerWithResult handler,
  2. Duration timeout
)

Implementation

Future<StreamedResults> execResultHandler(HandlerWithResult handler, Duration timeout) {
  var completer = Completer<StreamedResults>();

  _queue.run(() => _processHandler(handler).timeout(timeout)).catchError((e, st) {
    //print('_processHandler catchError');
    completer.completeError(e, st);
  }).onError((e, stackTrace) {
    completer.completeError(e!, stackTrace);
    //print('_processHandler onError');
  });
  handler.streamedResults.then((sr) => completer.complete(sr));
  /* try {
    _queue.run(() => _processHandler(handler).timeout(timeout));
    var sr = await handler.streamedResults;
    completer.complete(sr);
  } catch (e, s) {
    completer.completeError(e, s);
  }*/

  return completer.future;
}