caf_platform/gen_pipe

Generic message processing pipeline component.

Properties:

  {webSocketPipe: boolean, httpPipe: boolean, path: string}

where:

  • webSocketPipe: Whether this pipe should apply to websockets.
  • httpPipe: Whether this pipe should apply to http requests.
  • path: Route that activates this pipe.
Source:

Extends

Members

__ca_isPipe__ :boolean

Source:

Run-time type information.

Type:
  • boolean

Methods

__ca_connectSetup__(app)

Source:

Creates a connect middleware function with interface function(req, res, next), and registers it with the application.

Parameters:
Name Type Description
app Object

A connect application to register a middleware function.

__ca_isHttpPipe__() → {boolean}

Source:

Whether this pipe should be added to the http pipeline.

Returns:

True if this pipe should be added to the http pipeline.

Type
boolean

__ca_isWebSocketPipe__() → {boolean}

Source:

Whether this pipe should be added to the websocket pipeline.

Returns:

True if this pipe should be added to the websocket pipeline.

Type
boolean

__ca_send__(res, data)

Source:

Sends a reply on a websocket or an http post.

Parameters:
Name Type Description
res Object

A response stream object.

data string | Object

A JSON serialized object or an object to serialize.