Class: Qup::Adapter

Inherits:
Object
  • Object
show all
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.

Direct Known Subclasses

Kestrel, Maildir, Redis

Defined Under Namespace

Classes: Kestrel, Maildir, Redis

Class Method Summary collapse

Instance Method Summary collapse

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

#closeObject

Public: close the Adapter for further use

Returns nothing

Raises:

  • (NotImplementedError)


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

Returns:

  • (Boolean)

Raises:

  • (NotImplementedError)


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

Raises:

  • (NotImplementedError)


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

Raises:

  • (NotImplementedError)


37
38
39
# File 'lib/qup/adapter.rb', line 37

def topic( name )
  raise NotImplementedError, "please implement 'topic'"
end