forked from CEduStartup/Pyxis
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathservices.py
65 lines (52 loc) · 1.74 KB
/
services.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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# This file contains shared services definition.
# Services logic are defined in services dir.
from shared.Utils import port_randomizer
from config.context import create_context
class SharedServiceConfig:
# Service description.
description = None
# Should this service be run automatically ?
active = None
# Host to bind.
bind_host = '127.0.0.1'
# Port to bind.
bind_port = None
# Name of module under $ROOT_DIR/services.
module = 'service_trackers'
# Name of class inside module (described above).
handler = 'TrackersService'
class trackers(SharedServiceConfig):
"""Service which exports methods working with Trackers."""
description = 'trackers operations'
active = True
bind_host = '127.0.0.1'
bind_port = 8002 + port_randomizer()
module = 'service_trackers'
handler = 'TrackersService'
class launcher(SharedServiceConfig):
"""This service is used by system launcher. it is not automatically created
by services_launcher.py."""
description = 'System Launcher'
active = False
bind_host = '127.0.0.1'
bind_port = 8999 + port_randomizer()
module = None
handler = None
class mongo_storage(SharedServiceConfig):
"""Service which exports methods working with MongoDB"""
description = 'mongodb operations'
active = True
bind_host = '127.0.0.1'
bind_port = 8001 + port_randomizer()
module = 'service_mongo_storage'
handler = 'MongoStorage'
class test(SharedServiceConfig):
"""Test service."""
description = 'test service'
active = False
bind_host = '127.0.0.1'
bind_port = 8003 + port_randomizer()
module = 'service_test'
handler = 'TestService'
component_name = 'shared_services'
create_context(component_name)