Class: Qup::Adapter::Kestrel::Destination
- Inherits:
-
Object
- Object
- Qup::Adapter::Kestrel::Destination
- Defined in:
- lib/qup/adapter/kestrel/destination.rb
Overview
Internal: The Common base class for Kestrel Topic and Queue
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Internal: the name of the Queue or Topic.
Instance Method Summary collapse
-
#destroy ⇒ Object
Internal: Destroy the Topic or Queue.
-
#initialize(address, name) ⇒ Destination
constructor
Internal: Create a new Topic or Queue.
-
#ping ⇒ Object
Internal: Make sure the Topic or Queue exists.
Constructor Details
#initialize(address, 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
Returns a new Topic.
16 17 18 19 20 21 22 |
# File 'lib/qup/adapter/kestrel/destination.rb', line 16 def initialize( address, name ) @address = address @client = blocking_transactional_client( @address ) @admin_client = regular_client( @address ) @name = name ping end |
Instance Attribute Details
#name ⇒ Object (readonly)
Internal: the name of the Queue or Topic
8 9 10 |
# File 'lib/qup/adapter/kestrel/destination.rb', line 8 def name @name end |
Instance Method Details
#destroy ⇒ Object
Internal: Destroy the Topic or Queue
If possible remove the existence of the Topic from the System
Returns nothing.
29 30 31 32 |
# File 'lib/qup/adapter/kestrel/destination.rb', line 29 def destroy @admin_client.delete( name ) @admin_client.delete( name+"_errors" ) end |
#ping ⇒ Object
Internal: Make sure the Topic or Queue exists
Returns nothing
37 38 39 40 |
# File 'lib/qup/adapter/kestrel/destination.rb', line 37 def ping @admin_client.peek( name ) return true end |