Class: ActiveMessaging::Adapters::BaseConnection
- Inherits:
-
Object
- Object
- ActiveMessaging::Adapters::BaseConnection
- Includes:
- ActiveMessaging::Adapter
- Defined in:
- lib/activemessaging/adapters/base.rb
Overview
use this as a base for implementing new connections
Direct Known Subclasses
Adapter::Connection, AmazonSqs::Connection, ActiveMessaging::Adapters::Beanstalk::Connection, ReliableMsgConnection, Sqs::Connection, Stomp::Connection, Synch::Connection, Test::Connection
Instance Attribute Summary collapse
-
#reliable ⇒ Object
configurable params.
Instance Method Summary collapse
-
#disconnect ⇒ Object
called to cleanly get rid of connection.
-
#initialize(cfg) ⇒ BaseConnection
constructor
generic init method needed by a13g.
-
#receive(options = {}) ⇒ Object
receive a single message from any of the subscribed destinations check each destination once, then sleep for poll_interval adding options,optionally, so a poller can get certain messages (e.g. by priority).
-
#received(message, headers = {}) ⇒ Object
called after a message is successfully received and processed.
-
#send(destination_name, message_body, message_headers = {}) ⇒ Object
destination_name string, body string, headers hash send a single message to a destination.
-
#subscribe(destination_name, message_headers = {}) ⇒ Object
destination_name string, headers hash subscribe to listen on a destination.
-
#unreceive(message, headers = {}) ⇒ Object
called after a message is successfully received but unsuccessfully processed purpose is to return the message to the destination so receiving and processing and be attempted again.
-
#unsubscribe(destination_name, message_headers = {}) ⇒ Object
destination_name string, headers hash unsubscribe to listen on a destination.
Methods included from ActiveMessaging::Adapter
Constructor Details
#initialize(cfg) ⇒ BaseConnection
generic init method needed by a13g
18 19 |
# File 'lib/activemessaging/adapters/base.rb', line 18 def initialize cfg end |
Instance Attribute Details
#reliable ⇒ Object
configurable params
15 16 17 |
# File 'lib/activemessaging/adapters/base.rb', line 15 def reliable @reliable end |
Instance Method Details
#disconnect ⇒ Object
called to cleanly get rid of connection
22 23 |
# File 'lib/activemessaging/adapters/base.rb', line 22 def disconnect end |
#receive(options = {}) ⇒ Object
receive a single message from any of the subscribed destinations check each destination once, then sleep for poll_interval adding options,optionally, so a poller can get certain messages (e.g. by priority)
43 44 |
# File 'lib/activemessaging/adapters/base.rb', line 43 def receive(={}) end |
#received(message, headers = {}) ⇒ Object
called after a message is successfully received and processed
47 48 |
# File 'lib/activemessaging/adapters/base.rb', line 47 def received , headers={} end |
#send(destination_name, message_body, message_headers = {}) ⇒ Object
destination_name string, body string, headers hash send a single message to a destination
37 38 |
# File 'lib/activemessaging/adapters/base.rb', line 37 def send destination_name, , ={} end |
#subscribe(destination_name, message_headers = {}) ⇒ Object
destination_name string, headers hash subscribe to listen on a destination
27 28 |
# File 'lib/activemessaging/adapters/base.rb', line 27 def subscribe destination_name, ={} end |
#unreceive(message, headers = {}) ⇒ Object
called after a message is successfully received but unsuccessfully processed purpose is to return the message to the destination so receiving and processing and be attempted again
52 53 |
# File 'lib/activemessaging/adapters/base.rb', line 52 def unreceive , headers={} end |
#unsubscribe(destination_name, message_headers = {}) ⇒ Object
destination_name string, headers hash unsubscribe to listen on a destination
32 33 |
# File 'lib/activemessaging/adapters/base.rb', line 32 def unsubscribe destination_name, ={} end |