lib/module/PatternModule.js
function PatternModule(agent, options) {
  this.agent = agent;
  this.stopPropagation = options && options.stopPropagation || false;
  this.receiveOriginal = agent._receive;
  this.listeners = [];
}
function PatternModule(agent, options) {
  this.agent = agent;
  this.stopPropagation = options && options.stopPropagation || false;
  this.receiveOriginal = agent._receive;
  this.listeners = [];
}
function PatternModule ( agent , options ) { this . agent = agent ; this . stopPropagation = options && options . stopPropagation || false ; this . receiveOriginal = agent . _receive ; this . listeners = [ ] ; }
Create a pattern listener onto an Agent.
A new handler is added to the agents _receiver function.
Creates a Pattern instance with functions `listen` and `unlisten`.
@param {Agent} agent
@param {Object} [options]   Optional parameters. Can contain properties:
- stopPropagation: boolean
When false (default), a message
will be delivered at all
matching pattern listeners.
When true, a message will be
be delivered at the first
matching pattern listener only.
Create a pattern listener onto an Agent . A new handler is added to the agents _receiver function . Creates a Pattern instance with functions listen and unlisten .