-
-
Notifications
You must be signed in to change notification settings - Fork 371
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Run control channel in separate thread
- Loading branch information
1 parent
aba2179
commit bf48c69
Showing
6 changed files
with
91 additions
and
88 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
|
||
from threading import Thread | ||
import zmq | ||
if zmq.pyzmq_version_info() >= (17, 0): | ||
from tornado.ioloop import IOLoop | ||
else: | ||
# deprecated since pyzmq 17 | ||
from zmq.eventloop.ioloop import IOLoop | ||
|
||
|
||
class ControlThread(Thread): | ||
|
||
def __init__(self, context): | ||
Thread.__init__(self) | ||
self.context = context | ||
self.io_loop = IOLoop(make_current=False) | ||
|
||
def run(self): | ||
self.io_loop.make_current() | ||
self.io_loop.start() | ||
self.io_loop.close(all_fds=True) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters