NullMQ @ PDX

  • 7,383 views
Uploaded on

 

More in: Technology , Education
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
No Downloads

Views

Total Views
7,383
On Slideshare
0
From Embeds
0
Number of Embeds
0

Actions

Shares
Downloads
73
Comments
0
Likes
12

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

  • 1. NullMQ ZEROMQ SEMANTICS IN THE BROWSERJeff Lindsay Bulat Shakirzyanov@progrium @avalanche123
  • 2. libzmq
  • 3. High-level patterns libzmq
  • 4. PhilosophyHigh-level patterns libzmq
  • 5. PhilosophyHigh-level patterns libzmq
  • 6. PhilosophyHigh-level patterns API / Semantics libzmq
  • 7. Toolkit for building messaging systems...
  • 8. Toolkit for building messaging systems... ...behind your firewall
  • 9. Toolkit for building messaging systems... ...behind your firewall ...not for customers
  • 10. Toolkit for building messaging systems... ...behind your firewall ...not for customers ...certainly not with the browser
  • 11. WITH VOICE MAKE & RECEIVE PHONE CALLS SEND & RECEIVE TEXT MESSAGES INSTANTLY BUY PHONE NUMBERS ADD VOICE TO WEB & MOBILE APPS
  • 12. Browser Browser
  • 13. ZeroMQ in the browser?
  • 14. ZeroMQ in the browser? • libzmq is a C++ library
  • 15. ZeroMQ in the browser? • libzmq is a C++ library • Browser extension not viable
  • 16. ZeroMQ in the browser? • libzmq is a C++ library • Browser extension not viable • ZMTP is not valuable by itself
  • 17. Let’s say we did...
  • 18. Let’s say we did... • Security?
  • 19. Let’s say we did... • Security? • Skip existing auth infrastructure
  • 20. Let’s say we did... • Security? • Skip existing auth infrastructure • Need to make something up
  • 21. Let’s say we did... • Security? • Skip existing auth infrastructure • Need to make something up • Direct connections?
  • 22. Let’s say we did... • Security? • Skip existing auth infrastructure • Need to make something up • Direct connections? • Lots of open connections, open ports
  • 23. Let’s say we did... • Security? • Skip existing auth infrastructure • Need to make something up • Direct connections? • Lots of open connections, open ports • Just not “web friendly”
  • 24. PhilosophyHigh-level patterns API / Semantics libzmq
  • 25. PhilosophyHigh-level patterns API / Semantics libzmq
  • 26. What do we want?
  • 27. What do we want?• Near feature/semantic parity with ZeroMQ
  • 28. What do we want?• Near feature/semantic parity with ZeroMQ• Throughput performance not as important
  • 29. What do we want?• Near feature/semantic parity with ZeroMQ• Throughput performance not as important• Embrace nature of the web in design
  • 30. What do we want?• Near feature/semantic parity with ZeroMQ• Throughput performance not as important• Embrace nature of the web in design• Single connection, service multiplexing
  • 31. What do we want?• Near feature/semantic parity with ZeroMQ• Throughput performance not as important• Embrace nature of the web in design• Single connection, service multiplexing• Use existing transports, protocols, etc
  • 32. NullMQ What do we want?• Near feature/semantic parity with ZeroMQ• Throughput performance not as important• Embrace nature of the web in design• Single connection, service multiplexing• Use existing transports, protocols, etc
  • 33. What do we have?
  • 34. WebSocket
  • 35. WebSocket• ZMTP over WebSocket?
  • 36. WebSocket• ZMTP over WebSocket? • Connection inefficient
  • 37. WebSocket• ZMTP over WebSocket? • Connection inefficient • Not extensible
  • 38. WebSocket• ZMTP over WebSocket? • Connection inefficient • Not extensible • No easy parsers
  • 39. WebSocket
  • 40. WebSocket• STOMP over WebSocket?
  • 41. WebSocket• STOMP over WebSocket? • Existing parsers, easy to write
  • 42. WebSocket• STOMP over WebSocket? • Existing parsers, easy to write • Very much like HTTP
  • 43. WebSocket• STOMP over WebSocket? • Existing parsers, easy to write • Very much like HTTP • Used primarily to multiplex
  • 44. NullMQ
  • 45. var url = "ws://hostname/gateway";var ctx = new nullmq.Context(url);socket = ctx.socket(nullmq.REP);socket.bind("nullmq://echo");socket.recvall(function(request) { socket.send("Got: "+request);});
  • 46. var url = "ws://hostname/gateway";var ctx = new nullmq.Context(url);socket = ctx.socket(nullmq.REQ);socket.connect("nullmq://echo");socket.send("Hello world!");socket.recv(function(reply) { console.log(reply); // "Got: Hello world!"});
  • 47. Browser ServerApplication Application NullMQ NullMQ STOMP STOMP WebSocket WebSocket
  • 48. Browser Gateway BackendApplication Bridge ZMQ Socket NullMQ NullMQ ZMQ Socket STOMP STOMP ZMQ SocketWebSocket WebSocket
  • 49. Presence Demo
  • 50. NullMQ http://github.com/progrium/nullmqhttp://groups.google.com/group/nullmq @progrium @avalanche123
  • 51. STOMP
  • 52. STOMP• Simple and human-readable like HTTP
  • 53. STOMP• Simple and human-readable like HTTP• Extensible via headers
  • 54. STOMP• Simple and human-readable like HTTP• Extensible via headers• Library and server support
  • 55. STOMP• Simple and human-readable like HTTP• Extensible via headers• Library and server support• An easy WebSocket subprotocol
  • 56. STOMP• Simple and human-readable like HTTP• Extensible via headers• Library and server support• An easy WebSocket subprotocol• Can be used to model “virtual connections”
  • 57. STOMP• Simple and human-readable like HTTP• Extensible via headers• Library and server support• An easy WebSocket subprotocol• Can be used to model “virtual connections”• Transactions for multipart messages
  • 58. STOMP “Extensions”1. Frames include socket type header2. Header for “connect” or “bind” in SUBSCRIBE3. Req-Rep messages use “reply-to” header