Project

howler

0.0
No release in over 3 years
Low commit activity in last 3 years
There's a lot of open issues
An Asynchronous Message Queue that's always Chewing on Something
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 0
>= 0

Runtime

 Project Readme

Howler

###An asynchronous message queue that's always chewing on something.

#####Advantages

  • On-the-fly Configuration (via Howler::Config)
  • Simple message queueing interface.
  • Powerful and Fine-grained message retry logic.
  • Dashboard for managing and tracking message processing.
  • No need for an external Exception Notification Service.
  • Simple Message passing between Actors

###Usage 0. Rails 3 + Redis

  1. gem 'howler' in your Gemfile.
  2. bundle install.
  3. From the root of the Rails project run [bundle exec] howler.

####Configuration

Howler listens to configuration and updates accordingly.

  # Scale Workers
  Howler::Config[:concurrency] = 75

####Queueing Interface

class User [< ActiveRecord::Base]
  async :fetch_content

  def self.fetch_content(user_id)
    ...
  end
end

User.async_fetch_content(user.id)
#=> true

####Message Retry Handling

  • Retry a message every minute for up to 10 minutes
  def self.fetch_content(user_id)
    user = User.find(user_id)

    unless user.fetchable?
      raise Howler::Message::Retry(:after => 1.minute, :ttl => 10.minutes)
    end

    ... # fetch content
  end

####Exception Notification

  • Notify when an external API is down
  def self.fetch_content(user_id)
    ...
    begin
      # Try to fetch /home_timeline for the user
    rescue Twitter::Error::ServiceUnavailable => error
      raise Howler::Message::Notify.new(erorr)
    end
    
    ... # process the timeline
  end

####Message Passing

  • Pass messages by setting values into the shared configuration (key, value).
  def fetch_content(user_id)

    ... # done fetching content
    Howler::Config[user_id] = {:fetched_at => Time.now, :status => 'success'}.to_json

    # Then to delete a key simply assign nil
    Howler::Config[user_id] = nil
  end

####Dashboard (In Development)

  • Global settings management.
  • Change the default message retry handling.
  • Increase or Decrease the number of workers.
  • Explicitly retry, delete, or reschedule messages
  • Change the log-level (seeing higher error rates, so switch to the debug level)

#####Get rid of your Exception Notifier

  • Simply raise a Howler::Message::Notify exception
  • Raise with custom attributes and Howler will take care of the rest.
  • The Notifications tab will give you access to errors in real-time.