Class: Asynchronic::QueueEngine::Synchronic::Queue
- Inherits:
-
Object
- Object
- Asynchronic::QueueEngine::Synchronic::Queue
- Defined in:
- lib/asynchronic/queue_engine/synchronic.rb
Instance Method Summary collapse
-
#initialize(engine) ⇒ Queue
constructor
A new instance of Queue.
- #push(message) ⇒ Object
Constructor Details
#initialize(engine) ⇒ Queue
Returns a new instance of Queue.
43 44 45 |
# File 'lib/asynchronic/queue_engine/synchronic.rb', line 43 def initialize(engine) @engine = engine end |
Instance Method Details
#push(message) ⇒ Object
47 48 49 50 51 52 53 54 55 56 57 58 59 |
# File 'lib/asynchronic/queue_engine/synchronic.rb', line 47 def push() process = engine.environment.load_process() if engine.stubs[process.type] job = process.job block = engine.stubs[process.type] process.define_singleton_method :job do MockJob.new job, process, block end end process.execute end |