Module: Vigilem::Core::LockablePipelineComponent

Included in:
Adapters::Adapter, InputSystemHandler
Defined in:
lib/vigilem/core/lockable_pipeline_component.rb

Instance Method Summary collapse

Instance Method Details

#semaphoreObject

name collision with demultiplexer and bufferhandler



10
11
12
# File 'lib/vigilem/core/lockable_pipeline_component.rb', line 10

def semaphore
  @semaphore ||= (semaphore! || Monitor.new)
end

#semaphore!Object

checks #source component for #semaphore without memoization



16
17
18
# File 'lib/vigilem/core/lockable_pipeline_component.rb', line 16

def semaphore!
  self.respond.source.respond.semaphore
end

#synchronizeObject



22
23
24
25
26
# File 'lib/vigilem/core/lockable_pipeline_component.rb', line 22

def synchronize
  semaphore.synchronize do
    yield
  end
end