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