Pattern for event-driven devices (no polling)
|
|
---|---|
Hi Hopefully an easy question. I want a device that only updates clients via ZMQ events, with no need for polling (this is assumed to be more efficient). However, I also want to archive all changes to the attribute values to HDB++. Is the code below the correct pattern to follow? Specifically, for each attribute we need to call "set_change_event" and "set_archive_event" initially. And then for each attribute we need to call both "push_change_event" and "push_archive_event" whenever the attribute reading changes? I assume just using "push_change_event" would not be enough to get the values to HDB++.
That seems to be the pattern used here: https://github.com/MaxIV-KitsControls/tango-facadedevice/blob/37b39f7b8b8e8dabf9223efd359abb5047a6fd38/facadedevice/utils.py#L275 Thanks, Anton |
|
|
---|---|
Hi Anton, correct, you need to push both, as hdb++ relies on archive_event and push_change_event won't fire an archive event. |
|
|
---|---|
Thank for confirming, Lorenzo. |