Foreign-office

A light browser push framework that provides listeners on web clients and publishers on Rails servers. If you can keep all your business logic on the server and maintain a dumb client, life is serene. If you can do that while offering a live, interactive page with real-time updates, you're a rock star.

View the Project on GitHub edraut/foreign-office

want to wrap the http call to the bus?

ForeignOffice.config(
  bus: {
    ...your bus configurationi here...
    }),
  publish_method: ->(message){
    MyInstrumenter do
      ForeignOffice.publish! channel: 'exclamations_to_everyone', object: {shout_out: 'Hello world!'}
    end
  })

You can run any code you like here, but you must eventually call ForeignOffice.publish! with the same hash containing channel and object keys as usual. This is good if you want to: