-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
what does server.process(delay) do? #82
Comments
The SimpleServer.process spends as much time as delay in wait for client transactions. The actual time varies. In the following modification, the driver polls the CPU/MEMORY status and pushes the updates to the monitoring clients in a thread.
|
Thank you this is very useful!
What is appropriate time for delay. I see you use 0.1 s, why not use 0.01s or 1 second. How should go about picking dt? |
0.1 is quite arbitrarily chosen. Also because it is called in a tight loop, the server actually is always waiting for requests from the clients and driver. dt is the how frequent the driver updates the values. It is not coupled with the processing period. |
The fastest update I can get it around 1 second. Is it something in my code that takes time or there is limitation on the server side? I want to update around 0.3 seconds, then it does not feel like there is a gap between updates. server: https://github.com/vstadnytskyi/caproto-sandbox/blob/master/caproto_sandbox/transition/pcaspy/simple_daq_push_server.py even with poll function running in a thread I also get 1second per update. I cannot go faster |
I have figured it! I need to change SCAN to small value for each PV. what is the purpose of SCAN? is it the fastest update allowed? |
scan fields controls how often the read method is called. Any value is allowed, there is no checking. But the system has to be able to cope with it. On the other hand, the modified program structure is my comment is preferred, because it uses only one thread. |
Hi All,
I have found a docstring for server.process(delay)
but I still do not understand what it does exactly. For example, I have a server that reads my laptop's CPU MEMORY BATTERY etc. This is an example of ca server I made.
It works well. I have added print statement into while True loop to see how often it is called. I noticed that it is called many many time instead of every 2 seconds.
I had a GUI and a terminal client connected. When I disconnected them the rate dropped down to 2 second. So it seems to me that server.process processes one request at a time. And I assume that the read() function in MyDriver is called every time server.process is called. Is it correct? Is there some documentation on what is actually happening.
I prefer driver instance or device instance to push update whenever is needed instead of server pulling updates on a timer. for example, if a PV on a server changes I want all clients to get an updated ASAP
The text was updated successfully, but these errors were encountered: