Current Path : /usr/lib/python2.7/dist-packages/landscape/broker/ |
Current File : //usr/lib/python2.7/dist-packages/landscape/broker/server.pyc |
Tc @ su d Z d d l Z d d l m Z d d l m Z d d l m Z d d l m Z d Z d e f d YZ d S( s Bridge client side plugins to the C{MessageExchange}. The C{BrokerServer} provides C{BrokerClient}s with a mechanism to send messages to the server and, likewise, triggers those plugins to take action when a exchange is impending or resynchronisaton is required. Each C{BrokerClient} has to be registered using the L{BrokerServer.register_client} method, after which two way communications is possible between the C{BrokerServer} and the C{BrokerClient}. Resynchronisation Sequence ========================== See L{landscape.broker.exchange} sequence diagram for origin of the "resynchronize-clients" event. Diagram:: 1. [event 1] ---> BrokerServer : Event : "resynchronize-clients" 2. [event 2] <--- BrokerServer : Broadcast event : "resynchronize" 3. [optional: various L{BrowserClientPlugin}s respond to the "resynchronize" event to reset themselves and start report afresh.] (See: L{landscape.monitor.packagemonitor.PackageMonitor} L{landscape.monitor.plugin.MonitorPlugin} L{landscape.manager.keystonetoken.KeystoneToken} L{landscape.monitor.activeprocessinfo.ActiveProcessInfo} ) 4. [event 1] ---> MessageExchange : Event (NOTE, this is the same event as step 1 : "resynchronize-clients" it is handled by both BrokerServer and MessageExchange. See MessageExchange._resynchronize ) 5. MessageExchange ---> MessageExchange : Schedule urgent : exchange iN( t Deferred( t gather_results( t remote( t FAILEDc s( | j j d d f d } | S( s& Turns a L{BrokerServer} method into an event broadcaster. When the decorated method is called, an event is fired on all connected clients. The event will have the same name as the method being called, except that any underscore in the method name will be replaced with a dash. t _t -c sC g } x0 | j D]"