Sha256: e7528776f9bff56d85716ee2542ad08eadd707371d925b96fd0be3b4f719cd5f

Contents?: true

Size: 391 Bytes

Versions: 4

Compression:

Stored size: 391 Bytes

Contents

require 'roby/event'
module Roby::EventStructure
    relation :EnsuredEvent, :noinfo => true do
	def calling(context)
	    super if defined? super
	    each_ensured_event do |ev|
		if !ev.happened?
		    postpone(ev, "waiting for ensured event #{ev}") do
			ev.call(context) if ev.controlable?
		    end
		end
	    end
	end

	def ensure(event)
	    add_ensured_event event
	end
    end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
roby-0.7.1 lib/roby/relations/ensured.rb
roby-0.7.2 lib/roby/relations/ensured.rb
roby-0.7 lib/roby/relations/ensured.rb
roby-0.7.3 lib/roby/relations/ensured.rb