RequestController listen(dynamic process(Request request))

Sets the nextController that will receive a request after this one.

If this instance returns a Request from processRequest, that request is passed to process. process is invoked in the same try-catch block as processRequest.

See pipe and generate for variants of this methods that objects instead of closures.

Source

RequestController listen(FutureOr<RequestOrResponse> process(Request request)) {
  _nextController = new RequestController._withListener(process);
  return _nextController;
}