Efficient Polling and Subscriptions Management for Active and Passive Devices
This document outlines the architecture and functionality of a polling engine designed for monitoring device subscriptions in server frameworks. It covers key APIs for starting and stopping polling operations for both active and passive devices, alongside mechanisms for executing subscriptions. The framework facilitates communication between subscribers and listeners, providing methods for managing data values and their qualifiers. Detailed examples include different types of polling engines, such as periodic polling and timing-based polling, aimed at enhancing inter-device communication and data integrity.
Efficient Polling and Subscriptions Management for Active and Passive Devices
E N D
Presentation Transcript
GET SET MonitorON-OFF LISTENERS Device Server Subscription Manager Server Framework Subscriptions Polling Engine Forwarding Engine Get Set Poll Any Polling Mechanism MonitorOn Active Device Subscriber Active Device Listener Adapter
Polling Engine & Interfaces(Passive Device) SERVER API • Polling Engine & Interfaces • Poller getPoller (IOPoint iop) • void run() • void stop() • Boolean isRunning() • Polling Interface • void poll(IOPoint iop, Data value, ValueQualifier vq) • ValueQualifer signals that the value changed, unchanged, or ask to use the default comparison algorithm
Server Framework Poll Method(Passive Device Only - DRAFT) SERVER API • poll() • It is called by the Poller upon reception of an event • It walks through the his subscription list and, for each entry, it executes the implementation of the poll(IOPoint iop, Data value,…)interface • It then validates and pushes the operation results to the listeners • We will provide some common polling engine implementations: • e.g. Periodic poller, PLS poller, SL timing poller
MonitorOn / Off Interfaces & Push Method(Active Devices Only) SERVER API • Device Adapter (Subscriber) • monitorOn(IOPoint iop) • It executes the device specific subscription & activates the listener • monitorOff(IOPoint iop) • It executes the device specific unsubscribe • Active Device Listener (Publisher) • push(IOPoint iop, Data value, ValueQualifier vq)
Passive Adapter API Methods written by the user • get(IOPoint* iop, Data* value, Data* ctxt) • set(IOPoint* iop, Data* value, Data* ctxt) • poller* getPoller(IOPoint* iop = 0) • void poll(IOPoint* iop, Data* value, ValueQualifier* qualifier) • Poller methods run(), stop(), isRunning()
Active Adapter API Methods written by the user • monitorOn(IOPoint* iop) • monitorOff(IOPoint* iop) • get(IOPoint* iop, Data* value, Data* ctxt) • set(IOPoint* iop, Data* value, Data* ctxt) Called by user to push • void push(IOPoint* iop, Data* value, ValueQualifier* qualifier, cmwDeviceServer*srv_ptr = 0)