-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #33 from TheGhouls/oct-0.4.6
- Loading branch information
Showing
26 changed files
with
441 additions
and
98 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 |
---|---|---|
@@ -1,2 +1,8 @@ | ||
[run] | ||
concurrency=multiprocessing | ||
|
||
[report] | ||
omit = oct/utilities/templates/scripts/v_user.j2 | ||
omit = | ||
oct/utilities/templates/scripts/v_user.j2 | ||
oct/core/devices.py | ||
oct/utilities/run_device.py |
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
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 |
---|---|---|
@@ -1 +1 @@ | ||
__version__ = '0.4.5' | ||
__version__ = '0.4.6' |
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,57 @@ | ||
"""Contain all zeromq devices needed by OCT | ||
""" | ||
from __future__ import print_function, unicode_literals | ||
import zmq | ||
|
||
|
||
def forwarder(frontend, backend): | ||
"""Simple pub/sub forwarder | ||
:param int frontend: fontend zeromq port | ||
:param int backend: backend zeromq port | ||
""" | ||
try: | ||
context = zmq.Context() | ||
|
||
front_sub = context.socket(zmq.SUB) | ||
front_sub.bind("tcp://*:%d" % frontend) | ||
|
||
front_sub.setsockopt_string(zmq.SUBSCRIBE, "") | ||
|
||
back_pub = context.socket(zmq.PUB) | ||
back_pub.bind("tcp://*:%d" % backend) | ||
|
||
print("forwarder started, backend on port : %d\tfrontend on port: %d" % (backend, frontend)) | ||
zmq.proxy(front_sub, back_pub) | ||
except Exception as e: | ||
print(e) | ||
finally: | ||
front_sub.close() | ||
back_pub.close() | ||
context.term() | ||
|
||
|
||
def streamer(frontend, backend): | ||
"""Simple push/pull streamer | ||
:param int frontend: fontend zeromq port | ||
:param int backend: backend zeromq port | ||
""" | ||
try: | ||
context = zmq.Context() | ||
|
||
front_pull = context.socket(zmq.PULL) | ||
front_pull.set_hwm(0) | ||
front_pull.bind("tcp://*:%d" % frontend) | ||
|
||
back_push = context.socket(zmq.PUSH) | ||
back_push.bind("tcp://*:%d" % backend) | ||
|
||
print("streamer started, backend on port : %d\tfrontend on port: %d" % (backend, frontend)) | ||
zmq.proxy(front_pull, back_push) | ||
except Exception as e: | ||
print(e) | ||
finally: | ||
front_pull.close() | ||
back_push.close() | ||
context.term() |
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
Oops, something went wrong.