Class: Asynchronic::QueueEngine::Synchronic
- Inherits:
-
Object
- Object
- Asynchronic::QueueEngine::Synchronic
- Defined in:
- lib/asynchronic/queue_engine/synchronic.rb
Defined Under Namespace
Instance Attribute Summary collapse
-
#stubs ⇒ Object
readonly
Returns the value of attribute stubs.
Instance Method Summary collapse
- #[](name) ⇒ Object
- #active_connections ⇒ Object
- #asynchronic? ⇒ Boolean
- #default_queue ⇒ Object
- #environment ⇒ Object
-
#initialize(options = {}) ⇒ Synchronic
constructor
A new instance of Synchronic.
- #stub(job, &block) ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ Synchronic
Returns a new instance of Synchronic.
7 8 9 10 |
# File 'lib/asynchronic/queue_engine/synchronic.rb', line 7 def initialize(={}) @options = @stubs = {} end |
Instance Attribute Details
#stubs ⇒ Object (readonly)
Returns the value of attribute stubs.
5 6 7 |
# File 'lib/asynchronic/queue_engine/synchronic.rb', line 5 def stubs @stubs end |
Instance Method Details
#[](name) ⇒ Object
20 21 22 |
# File 'lib/asynchronic/queue_engine/synchronic.rb', line 20 def [](name) Queue.new self end |
#active_connections ⇒ Object
32 33 34 |
# File 'lib/asynchronic/queue_engine/synchronic.rb', line 32 def active_connections [Asynchronic.connection_name] end |
#asynchronic? ⇒ Boolean
28 29 30 |
# File 'lib/asynchronic/queue_engine/synchronic.rb', line 28 def asynchronic? false end |
#default_queue ⇒ Object
12 13 14 |
# File 'lib/asynchronic/queue_engine/synchronic.rb', line 12 def default_queue Asynchronic.default_queue end |
#environment ⇒ Object
16 17 18 |
# File 'lib/asynchronic/queue_engine/synchronic.rb', line 16 def environment @environment ||= .fetch(:environment, Asynchronic.environment) end |
#stub(job, &block) ⇒ Object
24 25 26 |
# File 'lib/asynchronic/queue_engine/synchronic.rb', line 24 def stub(job, &block) stubs[job] = block end |