generate method

RequestController generate (RequestController instantiator())

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

If this instance returns a Request from processRequest, that request is passed to the instance created by instantiator's receive method. This method differs from pipe in that instantiator creates a new instance for each HTTP request, whereas pipe reuses the same controller for reach request.

See listen for a variant of this method that takes a closure instead of an object.

See pipe for a variant of this method that reuses the same object for each HTTP request.


RequestController generate(RequestController instantiator()) {
  _nextController = new _RequestControllerGenerator(instantiator);
  return _nextController;