ZeroMQ

  • 3,094 views
Uploaded on

Using 0mq from Ruby.

Using 0mq from Ruby.

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
3,094
On Slideshare
0
From Embeds
0
Number of Embeds
3

Actions

Shares
Downloads
80
Comments
0
Likes
11

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
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n

Transcript

  • 1. http://zero.mq/
  • 2. A ØMQ socket is what you get whenyou take a normal TCP socket, injectit with a mix of radioactive isotopes stolen from a secret Soviet atomic research project, bombard it with1950-era cosmic rays, and put it into the hands of a drug-addled comic book author with a badly-disguised fetish for bulging muscles clad in spandex. Yes, ØMQ sockets are the world-saving superheros of the networking world.
  • 3. Problem
  • 4. How to easy connectany code to any code, anywhere
  • 5. Existing solutions
  • 6. Connect• In-process in-proc://some-point• Unix sockets ipc://some/pipe• BSD sockets tcp://0.0.0.0:1234• Others multicast (PGM) ...
  • 7. BSD Sockets
  • 8. BSD Protocols TCP * Images by Tenouk
  • 9. BSD Protocols UDP TCP * Images by Tenouk
  • 10. BSD Sockets • New/Exit - socket() , close() • Configure - setsockopt() • Connect - bind() , connect() • Use - send() , recv()
  • 11. BSD Problems• Need to choice of transport• Stream (TCP) , datagram (UDP)• Peer-2-Peer connections
  • 12. zguide.zero.mq
  • 13. A ØMQ socket is what you get whenyou take a normal TCP socket, injectit with a mix of radioactive isotopes stolen from a secret Soviet atomic research project, bombard it with1950-era cosmic rays, and put it into the hands of a drug-addled comic book author with a badly-disguised fetish for bulging muscles clad in spandex. Yes, ØMQ sockets are the world-saving superheros of the networking world.
  • 14. in a Hundred Words ØMQ (ZeroMQ, 0MQ, zmq) looks like an embeddable networking library but acts like a concurrency framework. It gives you sockets that carry whole messages acrossvarious transports like in-process, inter-process, TCP, and multicast. You can connect sockets N-to-N with patterns likefanout, pub-sub, task distribution, and request-reply. Its fast enough to be the fabric for clustered products. Its asynchronous I/O model gives you scalable multicoreapplications, built as asynchronous message-processing tasks. It has a score of language APIs and runs on most operating systems. ØMQ is from iMatix and is LGPL open source.
  • 15. Many languages * Images by iMatrix
  • 16. Sockets•Well known API•Messages oriented• Transport agnostic•Socket-level topology
  • 17. Well known API
  • 18. BSD Sockets • New/Exit - socket() • Configure - setsockopt() • Connect - bind() • Use - send() , recv()
  • 19. Sockets• New/Exit - zmq_socket()• Configure - zmq_setsockopt()• Connect - zmq_bind()• Use - zmq_send() , zmq_recv()
  • 20. Hello world (server)
  • 21. Hello world (client)
  • 22. Message oriented
  • 23. Message oriented SendReceive
  • 24. Various transports
  • 25. Various transports• req.bind(‘inproc://some/pipe’)• req.bind(‘ipc://some/pipe’)• req.bind(’tcp://127.0.0.1:5555’)
  • 26. PatternsSocket level topology
  • 27. Request - Reply * Images by iMatrix
  • 28. Publish - Subscribe * Images by iMatrix
  • 29. Parallel tasks * Images by iMatrix
  • 30. Demo
  • 31. Scale
  • 32. Start small * Images by iMatrix
  • 33. Bigger * Images by iMatrix
  • 34. And bigger... * Images by iMatrix
  • 35. Devices Device * Images by iMatrix
  • 36. QUEUE * Images by iMatrix
  • 37. Demo
  • 38. Implementation
  • 39. Ruby-FFIForeign Function Interface
  • 40. Ruby-FFI
  • 41. Ruby-FFI (Win)
  • 42. Why FFI?•Debian: no need from *-dev• Multi-platform• Easy to read (Ruby, not C)
  • 43. Projectshttp://zeromq.org/docs:labs
  • 44. http://mongrel2.org
  • 45. Evolution App App App HTTP HTTP HTTP Net Net NetWebrick Mongrel Thin
  • 46. Evolution App HTTP Net Mongrel2
  • 47. Mongrel2Push/Pull 0mq Pub/Sub Handler Handler Responses HandlerRequests
  • 48. Demo
  • 49. Future• Part of Linux kernel• http://www.crossroads.io/• zerocloud ?
  • 50. Thank you!