-
Notifications
You must be signed in to change notification settings - Fork 17
/
index.js
56 lines (48 loc) · 2.64 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
exports.Agent = require('./lib/Agent');
exports.ServiceManager = require('./lib/ServiceManager');
exports.TransportManager = require('./lib/TransportManager');
exports.module = {
BabbleModule: require('./lib/module/BabbleModule'),
PatternModule: require('./lib/module/PatternModule'),
RequestModule: require('./lib/module/RequestModule'),
RPCModule: require('./lib/module/RPCModule')
};
exports.transport = {
Transport: require('./lib/transport/Transport'),
AMQPTransport: require('./lib/transport/amqp/AMQPTransport'),
DistribusTransport: require('./lib/transport/distribus/DistribusTransport'),
HTTPTransport: require('./lib/transport/http/HTTPTransport'),
LocalTransport: require('./lib/transport/local/LocalTransport'),
PubNubTransport: require('./lib/transport/pubnub/PubNubTransport'),
WebSocketTransport: require('./lib/transport/websocket/WebSocketTransport'),
connection: {
Connection: require('./lib/transport/Connection'),
AMQPConnection: require('./lib/transport/amqp/AMQPConnection'),
DistribusConnection: require('./lib/transport/distribus/DistribusConnection'),
HTTPConnection: require('./lib/transport/http/HTTPConnection'),
LocalConnection: require('./lib/transport/local/LocalConnection'),
PubNubConnection: require('./lib/transport/pubnub/PubNubConnection'),
WebSocketConnection: require('./lib/transport/websocket/WebSocketConnection')
}
};
exports.hypertimer = require('hypertimer');
exports.util = require('./lib/util');
// register all modules at the Agent
exports.Agent.registerModule(exports.module.BabbleModule);
exports.Agent.registerModule(exports.module.PatternModule);
exports.Agent.registerModule(exports.module.RequestModule);
exports.Agent.registerModule(exports.module.RPCModule);
// register all transports at the TransportManager
exports.TransportManager.registerType(exports.transport.AMQPTransport);
exports.TransportManager.registerType(exports.transport.DistribusTransport);
exports.TransportManager.registerType(exports.transport.HTTPTransport);
exports.TransportManager.registerType(exports.transport.LocalTransport);
exports.TransportManager.registerType(exports.transport.PubNubTransport);
exports.TransportManager.registerType(exports.transport.WebSocketTransport);
// load the default ServiceManager, a singleton, initialized with a LocalTransport
exports.system = new exports.ServiceManager();
exports.system.transports.add(new exports.transport.LocalTransport());
// override Agent.getTransportById in order to support Agent.connect(transportId)
exports.Agent.getTransportById = function (id) {
return exports.system.transports.get(id);
};