Class: Qup::Adapter
- Inherits:
-
Object
- Object
- Qup::Adapter
- Defined in:
- lib/qup/adapter.rb,
lib/qup/adapter/redis.rb,
lib/qup/adapter/kestrel.rb,
lib/qup/adapter/maildir.rb
Overview
Public: The module that Qup Adapters must extend
Any backing system that implements the Qup API must have an entry point that inherits from Adapter.
Defined Under Namespace
Classes: Kestrel, Maildir, Redis
Class Method Summary collapse
-
.register(name) ⇒ Object
Public: Register the child as an Adapter.
Instance Method Summary collapse
-
#close ⇒ Object
Public: close the Adapter for further use.
-
#closed? ⇒ Boolean
Public: is the Adapter closed.
-
#queue(name) ⇒ Object
Public: Create a Queue with the given name.
-
#topic(name) ⇒ Object
Public: Create a Topic with the given name.
Class Method Details
.register(name) ⇒ Object
Public: Register the child as an Adapter
name - the name of the adapter. This will be the URI scheme value
Return nothing
17 18 19 |
# File 'lib/qup/adapter.rb', line 17 def self.register( name ) Adapters[name.to_s] ||= self end |
Instance Method Details
#close ⇒ Object
Public: close the Adapter for further use
Returns nothing
45 46 47 |
# File 'lib/qup/adapter.rb', line 45 def close raise NotImplementedError, "please implement 'close'" end |
#closed? ⇒ Boolean
Public: is the Adapter closed
Returns true or false
53 54 55 |
# File 'lib/qup/adapter.rb', line 53 def closed? raise NotImplementedError, "please implement 'closed?'" end |
#queue(name) ⇒ Object
Public: Create a Queue with the given name
name - then name of the Queue to create
Returns a Qup::QueueAPI compatible object
27 28 29 |
# File 'lib/qup/adapter.rb', line 27 def queue( name ) raise NotImplementedError, "please implement 'queue'" end |
#topic(name) ⇒ Object
Public: Create a Topic with the given name
name - then name of the Topic to create
Returns a Qup::TopicAPI compatible object
37 38 39 |
# File 'lib/qup/adapter.rb', line 37 def topic( name ) raise NotImplementedError, "please implement 'topic'" end |