You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I define a client/server RPC service, from server side, I will call client side's function on timer.
Everything is ok ,but when I invoke async callback, it does not work.
I can see print(data) in function on_tick output right data
But at client side, I can't see any output in funciton on_event
Why?
Environment
rpyc newest
python 3.6
operating Windows11
Minimal example
Server Service
classMyServiceFactory(rpyc.Service, metaclass=MetaBase):
classexposed_MyTickService(object): # exposing names is not limited to methods :)def__init__(self, code_list, callback):
print(f"news client with {code_list} and {str(callback)} and ctx {MyServiceFactory.ctx}")
self.code_list=code_listself.callback=rpyc.async_(callback) # create an async callback# 调用订阅self.sub_id=getattr(MyServiceFactory.ctx, "subscribe_whole_quote")(code_list, self.on_tick)
print(self.sub_id)
defon_tick(self, data):
print(data)
self.callback(data)
defexposed_stop(self): # this method has to be exposed tooprint("处理tick订阅取消")
getattr(MyServiceFactory.ctx, "unsubscribe_quote")(self.sub_id)
Additional Information:
I change code in server side, do not use async call, when I call client side function directory, I got a lot of error message. please see attachment.
I define a client/server RPC service, from server side, I will call client side's function on timer.
Everything is ok ,but when I invoke async callback, it does not work.
I can see print(data) in function on_tick output right data
But at client side, I can't see any output in funciton on_event
Why?
Environment
Minimal example
Server Service
Client:
The text was updated successfully, but these errors were encountered: