-
Notifications
You must be signed in to change notification settings - Fork 44
Async mode server: dynamic attribute read/write/is_allowed are not called by worker #173
Comments
Probably got the same issue:
As a workaround I needed to decorate my methods: def run_in_executor(fn):
@functools.wraps(fn)
def wrapper(*args, **kwargs):
get_worker().execute(wrapper, *args, **kwargs)
return wrapper Howeve it would be nice to have this handled by PyTango. |
Hi |
Hi @stanislaw55 I wasn't planning on working on this. Would you consider helping by submitting a pull request? |
Hi @ajoubertza My setup: I did not tested this fix with (Py)Tango 9.3.x because of lack of such libraries compiled. However, I'll try to test it and maybe latest version from develop. Stay tuned! |
Okay, that was quick one The fix that worker for me import functools
from tango.server import get_worker
def run_in_executor(fn):
@functools.wraps(fn)
def wrapper(*args, **kwargs):
get_worker().execute(fn, *args, **kwargs)
return wrapper (mind that now in |
@stanislaw55 Well spotted - the If you're working on a PR, I suggest starting by adding one or more failing tests at the end of https://github.com/tango-controls/pytango/blob/develop/tests/test_server.py. I see there are actually no tests for is_allowed! You could base them on something like the one below. The Lines 153 to 171 in fa1193e
If you explicitly need Lines 383 to 391 in fa1193e
|
Thanks for detailed instrution on test, @ajoubertza! I'll try to make some time for PR in days to come |
In async mode (gevent, asyncio, ...) the dynamic attributes read, write and is_allowed methods are not called through the worker like the standard attributes
The text was updated successfully, but these errors were encountered: