UNPKG

446 BJavaScriptView Raw
1// This is a template for extending the base eve Agent prototype
2var eve = require('../../index');
3
4function MyAgent(id) {
5 eve.Agent.call(this, id);
6
7 // ... connect to some or all transports
8
9 // ... other initialization
10}
11
12MyAgent.prototype = Object.create(eve.Agent.prototype);
13MyAgent.prototype.constructor = MyAgent;
14
15MyAgent.prototype.receive = function (from, message) {
16 // ... handle incoming messages
17};
18
19module.exports = MyAgent;