-
Notifications
You must be signed in to change notification settings - Fork 0
/
containers.py
28 lines (15 loc) · 922 Bytes
/
containers.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
import logging
import dependency_injector.containers as containers
import dependency_injector.providers as providers
from dummyscanner import DummyScanner
from filepresenceproccesor import FilePresenceProcessor
class Core(containers.DeclarativeContainer):
config = providers.Configuration('config')
logger = providers.Singleton(logging.Logger, name='log')
presence_logger = providers.Singleton(logging.Logger, name='presence_logger')
class Services(containers.DeclarativeContainer):
identity_scanner = providers.Singleton(DummyScanner, logger=Core.logger)
presence_processor = providers.Singleton(FilePresenceProcessor, logger=Core.logger,
presence_logger=Core.presence_logger,
target=Core.config.target,
max_disconnect_pings=Core.config.max_disconnect_pings)