Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit dc55b6a

Browse files
committed
Adapt the patterns to the new channel API
1 parent 74217a7 commit dc55b6a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

zerorpc/patterns.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class ReqRep:
2828
def process_call(self, context, channel, req_event, functor):
2929
context.hook_server_before_exec(req_event)
3030
result = functor(*req_event.args)
31-
rep_event = channel.create_event('OK', (result,),
31+
rep_event = channel.new_event('OK', (result,),
3232
context.hook_get_task_context())
3333
context.hook_server_after_exec(req_event, rep_event)
3434
channel.emit_event(rep_event)
@@ -55,7 +55,7 @@ def process_call(self, context, channel, req_event, functor):
5555
xheader = context.hook_get_task_context()
5656
for result in iter(functor(*req_event.args)):
5757
channel.emit('STREAM', result, xheader)
58-
done_event = channel.create_event('STREAM_DONE', None, xheader)
58+
done_event = channel.new_event('STREAM_DONE', None, xheader)
5959
# NOTE: "We" made the choice to call the hook once the stream is done,
6060
# the other choice was to call it at each iteration. I don't think that
6161
# one choice is better than the other, so I'm fine with changing this

0 commit comments

Comments
 (0)