16
TANGO Events TANGO Events “To be or not to be ?” “To be or not to be ?” Architecture Implementation Demonstration (?) Open questions

TANGO Events “To be or not to be ?” Architecture Implementation Demonstration (?) Open questions

Embed Size (px)

Citation preview

Page 1: TANGO Events “To be or not to be ?” Architecture Implementation Demonstration (?) Open questions

TANGO Events TANGO Events “To be or not to be ?”“To be or not to be ?”

ArchitectureImplementationDemonstration (?)Open questions

Page 2: TANGO Events “To be or not to be ?” Architecture Implementation Demonstration (?) Open questions

TANGO Events – do they exist ?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++

Page 3: TANGO Events “To be or not to be ?” Architecture Implementation Demonstration (?) Open questions

TANGO Events – architectureTANGO Events – architecture

mysql

client 1

client 2

client 3

database

server 2

notifd

server 1 devices

devices

channelchannel

event(s)

IOR

factory

host

event(s)

command_inout

command_inout

Page 4: TANGO Events “To be or not to be ?” Architecture Implementation Demonstration (?) Open questions

TANGO Events – threadsTANGO Events – threads

polling thread

1.poll attributes2.push events3.heartbeat

device server

push thread

1.activate POA2.wait for events

keep-alive thread

1.check heartbeat2.send heartbeat

client

10 minutes

10 seconds

Page 5: TANGO Events “To be or not to be ?” Architecture Implementation Demonstration (?) Open questions

TANGO Events - implementationTANGO 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 !

Page 6: TANGO Events “To be or not to be ?” Architecture Implementation Demonstration (?) Open questions

TANGO Events – databaseTANGO 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

Page 7: TANGO Events “To be or not to be ?” Architecture Implementation Demonstration (?) Open questions

TANGO Events - APITANGO 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 !

Page 8: TANGO Events “To be or not to be ?” Architecture Implementation Demonstration (?) Open questions

TANGO Events – eventsTANGO 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

Page 9: TANGO Events “To be or not to be ?” Architecture Implementation Demonstration (?) Open questions

TANGO Events – filtersTANGO 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

Page 10: TANGO Events “To be or not to be ?” Architecture Implementation Demonstration (?) Open questions

TANGO Events – heartbeatTANGO 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

Page 11: TANGO Events “To be or not to be ?” Architecture Implementation Demonstration (?) Open questions

TANGO Events - PlatformsTANGO Events - PlatformsLinux

– main development platform

Solaris – next platform to port to

Windows – after Solaris– ordered notifd port from Duncan Grisby

Page 12: TANGO Events “To be or not to be ?” Architecture Implementation Demonstration (?) Open questions

TANGO Events - JavaTANGO Events - Java

Needs client side idl files to be compiledNeeds event.cpp to be ported to JavaNeed to modify ATK

Q : who and when ?

Page 13: TANGO Events “To be or not to be ?” Architecture Implementation Demonstration (?) Open questions

TANGO Events – push and pullTANGO 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()

Page 14: TANGO Events “To be or not to be ?” Architecture Implementation Demonstration (?) Open questions

TANGO Events – TODOTANGO Events – TODO

Implement :– reconnect policy in EventConsumer– state as an attribute

Port :– Solaris– Windows

Test :– Write test programs– TEST, TEST and TEST again !

Page 15: TANGO Events “To be or not to be ?” Architecture Implementation Demonstration (?) Open questions

TANGO Events - open questions ?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 minutesQ: should this be a property ?

Only attributes as eventsQ : should it be possible to send other types of events ?

Page 16: TANGO Events “To be or not to be ?” Architecture Implementation Demonstration (?) Open questions

TANGO Events - ConclusionTANGO Events - Conclusion

First version of TANGO events is available in C++omniNotify looks good (so far)Easy to integrate in TANGO thanks to ETNeed to answer open questionsReady to be ported to Java