Class: Qup::Adapter::Maildir

Inherits:
Qup::Adapter show all
Defined in:
lib/qup/adapter/maildir.rb,
lib/qup/adapter/maildir/queue.rb,
lib/qup/adapter/maildir/topic.rb

Overview

Internal: The backing adapter for Qup that uses Maildir as the messaging infrastructure

Defined Under Namespace

Classes: Queue, Topic

Instance Method Summary collapse

Methods inherited from Qup::Adapter

register

Constructor Details

#initialize(uri, options = {}) ⇒ Maildir

Internal: Create a new Maildir Adapter

uri - the URI instance for this adapter to use



15
16
17
18
19
20
# File 'lib/qup/adapter/maildir.rb', line 15

def initialize( uri, options = {} )
  @uri       = uri
  @options   = options
  @root_path = uri.path
  @closed    = false
end

Instance Method Details

#closeObject

Internal: Close the Maildir adapter

Return nothing



43
44
45
# File 'lib/qup/adapter/maildir.rb', line 43

def close
  @closed = true
end

#closed?Boolean

Internal: Is the Maildir Adapter closed

Returns true or false

Returns:

  • (Boolean)


50
51
52
# File 'lib/qup/adapter/maildir.rb', line 50

def closed?
  @closed
end

#queue(name) ⇒ Object

Internal: Create a new Queue from this Adapter

name - the String name of the Queue

Returns a Qup::Queue



27
28
29
# File 'lib/qup/adapter/maildir.rb', line 27

def queue( name )
  Qup::Adapter::Maildir::Queue.new( @root_path, name )
end

#topic(name) ⇒ Object

Internal: Create a new Topic from this Adapter

name - the name of this Topic

Returns a Qup::Topic



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

def topic( name )
  Qup::Adapter::Maildir::Topic.new( @root_path, name )
end