class ActiveMessaging::Adapters::BaseConnection

use this as a base for implementing new connections

Attributes

reliable[RW]

configurable params

Public Class Methods

new(cfg) click to toggle source

generic init method needed by a13g

# File lib/activemessaging/adapters/base.rb, line 18
def initialize cfg
end

Public Instance Methods

disconnect() click to toggle source

called to cleanly get rid of connection

# File lib/activemessaging/adapters/base.rb, line 22
def disconnect
end
receive(options={}) click to toggle source

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)

# File lib/activemessaging/adapters/base.rb, line 43
def receive(options={})
end
received(message, headers={}) click to toggle source

called after a message is successfully received and processed

# File lib/activemessaging/adapters/base.rb, line 47
def received message, headers={}
end
send(destination_name, message_body, message_headers={}) click to toggle source

destination_name string, body string, headers hash send a single message to a destination

# File lib/activemessaging/adapters/base.rb, line 37
def send destination_name, message_body, message_headers={}
end
subscribe(destination_name, message_headers={}) click to toggle source

destination_name string, headers hash subscribe to listen on a destination

# File lib/activemessaging/adapters/base.rb, line 27
def subscribe destination_name, message_headers={}
end
unreceive(message, headers={}) click to toggle source

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

# File lib/activemessaging/adapters/base.rb, line 52
def unreceive message, headers={}
end
unsubscribe(destination_name, message_headers={}) click to toggle source

destination_name string, headers hash unsubscribe to listen on a destination

# File lib/activemessaging/adapters/base.rb, line 32
def unsubscribe destination_name, message_headers={}
end