Class: Qup::Adapter::Kestrel::Destination

Inherits:
Object
  • Object
show all
Defined in:
lib/qup/adapter/kestrel/destination.rb

Overview

Internal: The Common base class for Kestrel Topic and Queue

Direct Known Subclasses

Queue, Topic

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client, name) ⇒ Destination

Internal: Create a new Topic or Queue

address - the Connection Address string for the Kestrel Client name - the String name of the Topic or Queue

Returns a new Topic or Queue.



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

def initialize( client, name )
  @client = client
  @name   = name
  ping
end

Instance Attribute Details

#nameObject (readonly)

Internal: the name of the Queue or Topic



7
8
9
# File 'lib/qup/adapter/kestrel/destination.rb', line 7

def name
  @name
end

Instance Method Details

#destroyObject

Internal: Destroy the Topic or Queue

If possible remove the existence of the Topic from the System

Returns nothing.



26
27
28
# File 'lib/qup/adapter/kestrel/destination.rb', line 26

def destroy
  @client.delete( name )
end

#pingObject

Internal: Make sure the Topic or Queue exists

Returns nothing



33
34
35
36
# File 'lib/qup/adapter/kestrel/destination.rb', line 33

def ping
  @client.peek( name )
  return true
end