Sha256: 8c72401a47d4208d43cfcfb44ae08053336cfcc74875bdbdf868772efecc91e4
Contents?: true
Size: 580 Bytes
Versions: 26
Compression:
Stored size: 580 Bytes
Contents
module Dynflow module Middleware::Common class Singleton < Middleware # Each action tries to acquire its own lock before the action's #plan starts def plan(*args) action.singleton_lock! pass(*args) end # At the start of #run we try to acquire action's lock unless it already holds it # At the end the action tries to unlock its own lock if the execution plan has no # finalize phase def run(*args) action.singleton_lock! unless action.holds_singleton_lock? pass(*args) end end end end
Version data entries
26 entries across 26 versions & 1 rubygems