1 | var eve = require('../../index');
|
2 |
|
3 | function RequestAgent(id) {
|
4 |
|
5 | eve.Agent.call(this, id);
|
6 |
|
7 |
|
8 | this.extend('request');
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 | this.connect(eve.system.transports.getAll());
|
16 | }
|
17 |
|
18 |
|
19 | RequestAgent.prototype = Object.create(eve.Agent.prototype);
|
20 | RequestAgent.prototype.constructor = RequestAgent;
|
21 |
|
22 |
|
23 | RequestAgent.prototype.receive = function (from, message) {
|
24 | console.log(from + ' said: ' + message);
|
25 |
|
26 |
|
27 | return 'Hi ' + from + ', nice to meet you!';
|
28 | };
|
29 |
|
30 | module.exports = RequestAgent;
|