Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
Hookbox• NoVa Python Meetup   • Salman (Shaq) Haq• Nov. 17th 2011
Hookbox  …is a COMET server and messagequeue that tightly integrates with yourapplication via web hooks and a REST        ...
Highlights•   Eventlet-based server•   RESTful server API•   Javascript pub/sub API•   “Channel”    – Name    – List of ac...
ArchitectureHTTP         WS HTTP       HTTP
Data FlowBrowser(s)  Browser      Hookbox                  App                         publish(,…-)
More about Channels• Channel:   – Name   – List of subscribers   – History/state• Other properties:   –   history: events ...
Javascript API<script src=“hookbox.min.js”></script><script>var conn = hookbox.connect(‘http://host:port’);conn.error = fu...
Publishing (server-side)import urllib, urllib2if __name__ == ‘__main__’:  u = ‘http://localhost:51515/rest/publish’  p = d...
Configuration•   Port, Interface•   Callback port, hostname, path, security token•   API security token•   admin password
Admin Backend
Limitations?•   File-based vs command-line configuration•   WSS:// support?•   More docs•   Scalable to millions of concur...
Thanks…QUESTIONS?
Upcoming SlideShare
Loading in …5
×

Hookbox

1,022 views

Published on

Intro to the Hookbox Comet Server.

Published in: Technology, Business
  • Be the first to comment

  • Be the first to like this

Hookbox

  1. 1. Hookbox• NoVa Python Meetup • Salman (Shaq) Haq• Nov. 17th 2011
  2. 2. Hookbox …is a COMET server and messagequeue that tightly integrates with yourapplication via web hooks and a REST interface.
  3. 3. Highlights• Eventlet-based server• RESTful server API• Javascript pub/sub API• “Channel” – Name – List of active subscribers/users – State information
  4. 4. ArchitectureHTTP WS HTTP HTTP
  5. 5. Data FlowBrowser(s) Browser Hookbox App publish(,…-)
  6. 6. More about Channels• Channel: – Name – List of subscribers – History/state• Other properties: – history: events that previously occurred (list). – history_size (int). – presenceful: share subscriber info (bool). – moderated: trigger webhook callback for any action (bool). – reflective: sender receives its own publications (bool). – polling: options to configure polling the app (dict). – … and a few others.
  7. 7. Javascript API<script src=“hookbox.min.js”></script><script>var conn = hookbox.connect(‘http://host:port’);conn.error = function ….;conn.onSubscribed = function (channel_name, subscription) { subscription.onPublish = function (frame) { // frame.payload contains the published data }};conn.subscribe(‘foo’);</script>
  8. 8. Publishing (server-side)import urllib, urllib2if __name__ == ‘__main__’: u = ‘http://localhost:51515/rest/publish’ p = dict(channel_name=‘foo’, payload=,‘samples’: *1,2,3,4,5+-, ....) p = urllib.urlencode(p) req = urllib2.Request(u, p) resp = urllib2.urlopen(req)
  9. 9. Configuration• Port, Interface• Callback port, hostname, path, security token• API security token• admin password
  10. 10. Admin Backend
  11. 11. Limitations?• File-based vs command-line configuration• WSS:// support?• More docs• Scalable to millions of concurrent connections?
  12. 12. Thanks…QUESTIONS?

×