Class: TorqueBox::Messaging::Topic

Inherits:
Destination show all
Defined in:
messaging/lib/torquebox/messaging/topic.rb

Constant Summary

DEFAULT_SUBSCRIBER_NAME =
'subscriber-1'

Constants inherited from Destination

Destination::PRIORITY_MAP

Instance Attribute Summary

Attributes inherited from Destination

#:connect_options, #:connection_factory, #:enumerable_options, #:java_destination, #:name

Class Method Summary (collapse)

Instance Method Summary (collapse)

Methods inherited from Destination

#_dump, _load, #each, #enumerable_options, #initialize, list, lookup, #normalize_options, #publish, #receive, #stop, #stop_sync, #wait_for_destination, wait_for_latch, with_destinationizer, #with_session

Constructor Details

This class inherits a constructor from TorqueBox::Messaging::Destination

Class Method Details

+ (Object) start(name, options = {})



36
37
38
39
40
41
42
43
44
# File 'messaging/lib/torquebox/messaging/topic.rb', line 36

def start(name, options={})
  exported = options.fetch(:exported, false)

  with_destinationizer do |destinationizer|
    destinationizer.create_topic(name, exported)
  end

  new(name, options)
end

Instance Method Details

- (Object) to_s



60
61
62
# File 'messaging/lib/torquebox/messaging/topic.rb', line 60

def to_s
  "[Topic: #{super}]"
end

- (Object) unsubscribe(subscriber_name = DEFAULT_SUBSCRIBER_NAME, options = { })



52
53
54
55
56
57
58
# File 'messaging/lib/torquebox/messaging/topic.rb', line 52

def unsubscribe(subscriber_name = DEFAULT_SUBSCRIBER_NAME, options = { })
  wait_for_destination(options[:startup_timeout]) do
    with_session do |session|
      session.unsubscribe( subscriber_name )
    end
  end
end