-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.py
46 lines (31 loc) · 1.24 KB
/
app.py
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
from lib.core.schedulerEngine import schedulerEngine
from lib.core.server import server
from lib.utils.config import config
from workers.factory import WorkerFactory
def main():
#Broker configuration
#server.brokerConfigReset()
#Initiate DB
server.dbServerConfig()
#1. Initiate producer engine part
producer = WorkerFactory.createWorker(workerType = config.PRODUCER_KEY)
#2. Initiate consumer engine part
consumer = WorkerFactory.createWorker(workerType = config.CONSUMER_KEY)
#3. Initiate publisher engine part
publisher = WorkerFactory.createWorker(workerType = config.PUBLISHER_KEY)
#4. Initiate subscriber engine part
analyzer = WorkerFactory.createWorker(workerType = config.ANALYZER_KEY)
#schedule all the app engine part for mutually run
appEngine = schedulerEngine()
appEngine.schedule(producer)
appEngine.schedule(consumer)
appEngine.schedule(publisher)
appEngine.schedule(analyzer)
#Start the app engine
appEngine.engineStart()
#appEngine.startManually(producer.broker)
#appEngine.startManually(consumer.broker)
#appEngine.startManually(analyzer.broker)
#appEngine.startManually(publisher.broker)
if __name__ == "__main__":
main()