-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtsingles.py
More file actions
35 lines (29 loc) · 897 Bytes
/
tsingles.py
File metadata and controls
35 lines (29 loc) · 897 Bytes
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
# -*- coding: utf-8 -*-
#
# Written by: Carlos Bazaga
#
# Licensed under BSD 2-Clause
#
from multiprocessing.managers import SyncManager, BaseManager
import multiprocessing as mp
import gestor_protocolos as GP
import gestor_layouts as GL
import dispatcher
class MyManager(SyncManager):
"""This class defines a subuclass of SyncManager."""
pass
# Class registration on managers.
MyManager.register('disp',dispatcher.Dispatcher)
MyManager.register('ges_pro',GP.Gestor_protocolos)
MyManager.register('ges_lays',GL.Gestor_layouts)
# Managers declaration. A process for eac manager.
dispatcher_manager = MyManager()
dispatcher_manager.start()
protocols_manager = MyManager()
protocols_manager.start()
lays_manager = MyManager()
lays_manager.start()
# Singletons instantiation.
disp = dispatcher_manager.disp()
ges_pro = protocols_manager.ges_pro()
ges_lays = lays_manager.ges_lays()