Show More
@@ -31,11 +31,12 b' from .kernelmanager import (KernelManager, SubSocketChannel,' | |||||
31 | class BlockingSubSocketChannel(SubSocketChannel): |
|
31 | class BlockingSubSocketChannel(SubSocketChannel): | |
32 |
|
32 | |||
33 | def __init__(self, context, session, address=None): |
|
33 | def __init__(self, context, session, address=None): | |
34 |
super(BlockingSubSocketChannel, self).__init__(context, session, |
|
34 | super(BlockingSubSocketChannel, self).__init__(context, session, | |
|
35 | address) | |||
35 | self._in_queue = Queue() |
|
36 | self._in_queue = Queue() | |
36 |
|
37 | |||
37 | def call_handlers(self, msg): |
|
38 | def call_handlers(self, msg): | |
38 |
io.rprint('[[Sub]]', msg) |
|
39 | #io.rprint('[[Sub]]', msg) # dbg | |
39 | self._in_queue.put(msg) |
|
40 | self._in_queue.put(msg) | |
40 |
|
41 | |||
41 | def msg_ready(self): |
|
42 | def msg_ready(self): | |
@@ -60,15 +61,16 b' class BlockingSubSocketChannel(SubSocketChannel):' | |||||
60 | return msgs |
|
61 | return msgs | |
61 |
|
62 | |||
62 |
|
63 | |||
63 |
|
||||
64 | class BlockingXReqSocketChannel(XReqSocketChannel): |
|
64 | class BlockingXReqSocketChannel(XReqSocketChannel): | |
65 |
|
65 | |||
66 | def __init__(self, context, session, address=None): |
|
66 | def __init__(self, context, session, address=None): | |
67 |
super(BlockingXReqSocketChannel, self).__init__(context, session, |
|
67 | super(BlockingXReqSocketChannel, self).__init__(context, session, | |
|
68 | address) | |||
68 | self._in_queue = Queue() |
|
69 | self._in_queue = Queue() | |
69 |
|
70 | |||
70 | def call_handlers(self, msg): |
|
71 | def call_handlers(self, msg): | |
71 |
io.rprint('[[XReq]]', msg) |
|
72 | #io.rprint('[[XReq]]', msg) # dbg | |
|
73 | self._in_queue.put(msg) | |||
72 |
|
74 | |||
73 | def msg_ready(self): |
|
75 | def msg_ready(self): | |
74 | """Is there a message that has been received?""" |
|
76 | """Is there a message that has been received?""" | |
@@ -91,17 +93,22 b' class BlockingXReqSocketChannel(XReqSocketChannel):' | |||||
91 | break |
|
93 | break | |
92 | return msgs |
|
94 | return msgs | |
93 |
|
95 | |||
|
96 | ||||
94 | class BlockingRepSocketChannel(RepSocketChannel): |
|
97 | class BlockingRepSocketChannel(RepSocketChannel): | |
|
98 | ||||
95 | def call_handlers(self, msg): |
|
99 | def call_handlers(self, msg): | |
96 |
io.rprint('[[Rep]]', msg) |
|
100 | #io.rprint('[[Rep]]', msg) # dbg | |
|
101 | pass | |||
97 |
|
102 | |||
98 |
|
103 | |||
99 | class BlockingHBSocketChannel(HBSocketChannel): |
|
104 | class BlockingHBSocketChannel(HBSocketChannel): | |
|
105 | ||||
100 | # This kernel needs rapid monitoring capabilities |
|
106 | # This kernel needs rapid monitoring capabilities | |
101 | time_to_dead = 0.2 |
|
107 | time_to_dead = 0.2 | |
102 |
|
108 | |||
103 | def call_handlers(self, since_last_heartbeat): |
|
109 | def call_handlers(self, since_last_heartbeat): | |
104 | io.rprint('[[Heart]]', since_last_heartbeat) # dbg |
|
110 | #io.rprint('[[Heart]]', since_last_heartbeat) # dbg | |
|
111 | pass | |||
105 |
|
112 | |||
106 |
|
113 | |||
107 | class BlockingKernelManager(KernelManager): |
|
114 | class BlockingKernelManager(KernelManager): |
General Comments 0
You need to be logged in to leave comments.
Login now