Module: Roby::Distributed::EventNotifications

Included in:
EventGenerator
Defined in:
lib/roby/distributed/notifications.rb

Overview

This module includes the hooks needed to notify our peers of event propagation (fired, forwarding and signalling)

Defined Under Namespace

Modules: PlanCacheCleanup

Instance Method Summary collapse

Instance Method Details

#fired(event) ⇒ Object

Hook called when an event has been emitted. It sends the PeerServer#event_fired message.



347
348
349
350
351
352
353
354
# File 'lib/roby/distributed/notifications.rb', line 347

def fired(event)
		super if defined? super
		if self_owned? && !Distributed.updating?(root_object)
 Distributed.each_updated_peer(root_object) do |peer|
			peer.transmit(:event_fired, self, event.object_id, event.time, event.context)
 end
		end
end

#forwarding(event, to) ⇒ Object

Hook called when an event is being forwarded. It sends the PeerServer#event_add_propagation message.



357
358
359
360
361
362
363
364
# File 'lib/roby/distributed/notifications.rb', line 357

def forwarding(event, to)
		super if defined? super
		if self_owned? && !Distributed.updating?(root_object)
 Distributed.each_updated_peer(root_object, to.root_object) do |peer|
			peer.transmit(:event_add_propagation, true, self, to, event.object_id, event.time, event.context)
 end
		end
end

#signalling(event, to) ⇒ Object

Hook called when an event is being forwarded. It sends the PeerServer#event_add_propagation message.



367
368
369
370
371
372
373
374
# File 'lib/roby/distributed/notifications.rb', line 367

def signalling(event, to)
		super if defined? super
		if self_owned? && !Distributed.updating?(root_object)
 Distributed.each_updated_peer(root_object, to.root_object) do |peer|
			peer.transmit(:event_add_propagation, false, self, to, event.object_id, event.time, event.context)
 end
		end
end