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
Indeed Server.forever() is not async, and is in p4p.server instead of p4p.server.asyncio.
In the short term you could instead do something like:
done=asyncio.Event()
# install signal handler to call done.set()withServer(...):
awaitdone.wait()
In the longer term, I see the convenience of an async equivalent of Server.forever(). I am not immediately sure where to add it. async/await can't appear in src/p4p/server/__init__.py as long as py2.7 is supported. I am not sure it would be worthwhile to add p4p.server.asyncio.Server just to add one classmethod. Maybe a helper method p4p.server.asyncio.serve_forever()?
Description
Server.forever
doesn't work with asyncSharedPV
s, probably due to this sleep:https://github.com/mdavidsaver/p4p/blob/f5c96bad937fff57f5243f72b7fdb89a408d0f4a/src/p4p/server/__init__.py#L175
To reproduce:
Run the following server:
Then run
pvput foo 12
Observed behaviour
pvput
times out:Expected behaviour
pvput
succeeds and updates the valueThe text was updated successfully, but these errors were encountered: