Commit e6e71c62 authored by Robin Obůrka's avatar Robin Obůrka

msgloop: Promote 'process' to mandatory argument

parent 1d9405a0
...@@ -28,7 +28,7 @@ def signal_handler(signum, frame): ...@@ -28,7 +28,7 @@ def signal_handler(signum, frame):
raise SignalReceived() raise SignalReceived()
def sn_main(box_name, setup=None, process=None, teardown=None, argparser=None, args=None): def sn_main(box_name, process, setup=None, teardown=None, argparser=None, args=None):
ctx = SN(zmq.Context.instance(), argparser or get_arg_parser(), args=args) ctx = SN(zmq.Context.instance(), argparser or get_arg_parser(), args=args)
socket_recv, socket_send = detect_and_get_sockets(ctx) socket_recv, socket_send = detect_and_get_sockets(ctx)
...@@ -36,8 +36,6 @@ def sn_main(box_name, setup=None, process=None, teardown=None, argparser=None, a ...@@ -36,8 +36,6 @@ def sn_main(box_name, setup=None, process=None, teardown=None, argparser=None, a
raise LoopError("Neither input nor output socket provided") raise LoopError("Neither input nor output socket provided")
if teardown and not setup: if teardown and not setup:
raise LoopError("There is teardown callback without setup") raise LoopError("There is teardown callback without setup")
if not process:
raise LoopError("Missing 'process' callback")
if not socket_recv and not inspect.isgeneratorfunction(process): if not socket_recv and not inspect.isgeneratorfunction(process):
raise LoopError("Generator is expected for output-only box") raise LoopError("Generator is expected for output-only box")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment