new RequestHandler()
Interface which specifies a request handler to receive request notifications.
Methods
-
onClose()
-
Called when the request handler is unregistered, or the session is closed.
-
onError(error)
-
Notification of a contextual error related to this handler. This is analogous to an Error being thrown. Situations in which
onError
is called include the session being closed before the handler is registered, a communication timeout, or a problem with the provided parameters. No further calls will be made to this handler.Parameters:
Name Type Description error
Object The error
-
onRequest(request, context, responder)
-
Called to indicate a request has been received.
Parameters:
Name Type Description request
Object The request that was received
context
Session.messages.RequestContext Context object that provides the session id (session that sent the request), path and session properties
responder
Session.messages.Responder The responder to dispatch a response back to the requester