Rails::Messaging API? (like Rails::Cache API)

Hi all,

messaging has become a pretty main-stream method for implementing inter process communication and Rack structure pretty much necessitates using messaging to implement pushing via websockets and there are various solutions around to facilitate this, each with its own API. Some solutions are easier for development, some solutions are better for production and the common denominator of the APIs is pretty uniform:

  • start channel
  • stop channel
  • publish
  • receive
  • receive and publish (RPC, server-side)
  • publish and receive (RPC, client-side)
    and various options include opening a channel that broadcasts to every subscriber or just one subscriber, persisting the queue on disk or not, timeout handling etc

for example: http://torquebox.org/documentation/3.0.0/messaging.html, https://github.com/ruby-amqp/bunny

Having a uniform API (akin to the Cache api) would significantly simplify use of messaging in Rails apps, make switching messaging solutions that much simpler and possibly open up new venues to attack push support for rails apps and generally improve the state of messaging in Rails, I’d really love to see it somewhere in Rails 4.x if possible and if there’s sufficient interest

Thoughts? :slight_smile:


I wonder how close this will resemble the Notification API we have now: http://api.rubyonrails.org/classes/ActiveSupport/Notifications.html