160 likes | 270 Views
TANGO Events “To be or not to be ?”. Architecture Implementation Demonstration (?) Open questions. TANGO Events – do they exist ?. YES ! First implementation available on SourceForge : cppapi Release_3_0_0_events-branch Implemented for : device servers in C++ device clients in C++.
E N D
TANGO Events “To be or not to be ?” • Architecture • Implementation • Demonstration (?) • Open questions
TANGO Events – do they exist ? • YES ! • First implementation available on SourceForge : • cppapi Release_3_0_0_events-branch • Implemented for : • device servers in C++ • device clients in C++
devices server 1 notifd server 2 devices TANGO Events – architecture command_inout host client 1 event(s) factory channel event(s) channel client 2 IOR client 3 database command_inout mysql
TANGO Events – threads client device server push thread 1.activate POA 2.wait for events keep-alive thread 1.check heartbeat 2.send heartbeat polling thread 1.poll attributes 2.push events 3.heartbeat 10 seconds 10 minutes
TANGO Events - implementation • Downloaded and compiled omniNotify alpha 2 version in omniORB/src/services • 2 singleton classes : • EventSupplier (server side) • EventConsumer (client side) • Notification daemon modified to export to TANGO database • Database modified : • added Event table • added commands to export + import events • Thanks to polling thread the integration into TANGO was very easy !
TANGO Events – database • Event table • Name : varchar(255) • Exported : int(11) • Ior : text • Host : varchar(255) • Server : varchar(255) • Pid : int(11) • Version : varchar(8) • Started : datetime • Stopped : datetime
TANGO Events - API • Client side : • DeviceProxy->subscribe_event(string attribute, string event, EventCallback*) • EventCallback (EventData *) • DeviceProxy* • string attribute • string event • string event_type • int delta_change • int delta_time • DeviceAttribute • bool err • DevErrorList &errors • Server side • simply recompile and link with Notification libraries !
TANGO Events – events • Events are sent as Attributes • on_change • event sent if delta_change > 10% of last event sent • on_alarm • event sent if attribute goes into alarm • periodic • event sent every polling period
TANGO Events – filters • Notification Service supports filters on events • Currently all clients automatically filter for the event of their choice • In the future clients can specify filters on any of the filterable fields : • delta_change • delta_time
TANGO Events – heartbeat • Aim • Detect server or notification daemon crashes • Only send events if there are subscribers • Server side : • Server sends a heartbeat to its channel every 10 seconds • Client detects this heartbeat and uses it to determine whether server is alive • Client side : • Client resubscribes to all of its events every 10 minutes • Server uses this to decide whether to keep on sending events
TANGO Events - Platforms • Linux • main development platform • Solaris • next platform to port to • Windows • after Solaris • ordered notifd port from Duncan Grisby
TANGO Events - Java • Needs client side idl files to be compiled • Needs event.cpp to be ported to Java • Need to modify ATK Q : who and when ?
TANGO Events – push and pull • push-push • Server pushes events to notification daemon • Notification daemon pushes events to client • Quickest way of getting events to clients • Current model • push-pull • Server pushes events to notification daemon • Notification daemon queues events • Client polls/pulls events from notification daemon • DeviceProxy->try_pull_events()
TANGO Events – TODO • Implement : • reconnect policy in EventConsumer • state as an attribute • Port : • Solaris • Windows • Test : • Write test programs • TEST, TEST and TEST again !
TANGO Events - open questions ? • Delta on change (default = 10%) Q : should this be an attribute property ? • Polling frequency • same as for cache device (default = 1 second) Q : should this be an attribute property ? • Heartbeats • Server = 10 seconds, Client = 10 minutes Q: should this be a property ? • Only attributes as events Q : should it be possible to send other types of events ?
TANGO Events - Conclusion • First version of TANGO events is available in C++ • omniNotify looks good (so far) • Easy to integrate in TANGO thanks to ET • Need to answer open questions • Ready to be ported to Java