Skip to content

Instantly share code, notes, and snippets.

@casualjim
Created April 7, 2011 13:39
Show Gist options
  • Save casualjim/907789 to your computer and use it in GitHub Desktop.
Save casualjim/907789 to your computer and use it in GitHub Desktop.
BackchatIO("firstbox", :api_key => "the_key").each do |message|
# do stuff with message here
end
def BackchatIO(name, params)
Backchat::Stream.new(name, params)
end
module Backchat
class Stream(name, params)
# wrap fetcher here
def each(&b)
fetcher.listen(stream_params, &b)
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment