module HonestPubsub

Internal database logger that saves the publish message before it is send and also acts as a sink for messages.

Internal log class that is used to log messages before sending, after receiving, and failure to send

Manages a logger that can be used throughout the pubsub gem The logger can be set to any object that quacks like a logger including the Rails logger if so desired

The logger can be set in the initializer of a program or anywhere throughout as HonestPubsub.logger = Rails.logger for example

Middleware to ensure that we clear the context with every request

This railtie provides Rails engine hooks

In order to use the server, the caller must be able to bring in the necessary classes for require before instantiating the instance.

This class provders the worker for executing the subscriber. It receives a message from rabbitmq and creates an instance of the subscriber to execute with the message and context

Constants

VERSION

Public Class Methods

logger() click to toggle source
# File lib/honest_pubsub.rb, line 39
def self.logger
  HonestPubsub::Logging.logger
end
logger=(logger) click to toggle source

@param [Logger] logger Logger used by HonestPubsub

# File lib/honest_pubsub.rb, line 44
def self.logger=(logger)
  HonestPubsub::Logging.logger = logger
end
publish(routing_key, payload) click to toggle source

This method publishes payload to rabbitmq. All listeners with appropriate routing keys will receive the payload. @param [String] routing_key Identifier of the message type @param [Hash] payload The data that will be passed to the subscriber

# File lib/honest_pubsub.rb, line 35
def self.publish(routing_key, payload)
  Publisher.instance.publish(HonestPubsub::Context.instance, routing_key, payload)
end
root() click to toggle source
# File lib/honest_pubsub.rb, line 26
def self.root
  File.expand_path '../..', __FILE__
end