Diese Präsentation wurde erfolgreich gemeldet.
Die SlideShare-Präsentation wird heruntergeladen. ×
Anzeige
Anzeige
Anzeige
Anzeige
Anzeige
Anzeige
Anzeige
Anzeige
Anzeige
Anzeige
Anzeige
Anzeige
Nächste SlideShare
Overview of ZeroMQ
Overview of ZeroMQ
Wird geladen in …3
×

Hier ansehen

1 von 54 Anzeige
Anzeige

Weitere Verwandte Inhalte

Diashows für Sie (20)

Anzeige

Ähnlich wie ZeroMQ (20)

Weitere von Stoyan Zhekov (18)

Anzeige

Aktuellste (20)

ZeroMQ

  1. 1. http://zero.mq/
  2. 2. A ØMQ socket is what you get when you take a normal TCP socket, inject it with a mix of radioactive isotopes stolen from a secret Soviet atomic research project, bombard it with 1950-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. 3. Problem
  4. 4. How to easy connect any code to any code, anywhere
  5. 5. Existing solutions
  6. 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. 7. BSD Sockets
  8. 8. BSD Protocols TCP * Images by Tenouk
  9. 9. BSD Protocols UDP TCP * Images by Tenouk
  10. 10. BSD Sockets • New/Exit - socket() , close() • Configure - setsockopt() • Connect - bind() , connect() • Use - send() , recv()
  11. 11. BSD Problems • Need to choice of transport • Stream (TCP) , datagram (UDP) • Peer-2-Peer connections
  12. 12. zguide.zero.mq
  13. 13. A ØMQ socket is what you get when you take a normal TCP socket, inject it with a mix of radioactive isotopes stolen from a secret Soviet atomic research project, bombard it with 1950-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. 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 across various transports like in-process, inter-process, TCP, and multicast. You can connect sockets N-to-N with patterns like fanout, pub-sub, task distribution, and request-reply. It's fast enough to be the fabric for clustered products. Its asynchronous I/O model gives you scalable multicore applications, 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. 15. Many languages * Images by iMatrix
  16. 16. Sockets •Well known API •Messages oriented • Transport agnostic •Socket-level topology
  17. 17. Well known API
  18. 18. BSD Sockets • New/Exit - socket() • Configure - setsockopt() • Connect - bind() • Use - send() , recv()
  19. 19. Sockets • New/Exit - zmq_socket() • Configure - zmq_setsockopt() • Connect - zmq_bind() • Use - zmq_send() , zmq_recv()
  20. 20. Hello world (server)
  21. 21. Hello world (client)
  22. 22. Message oriented
  23. 23. Message oriented Send Receive
  24. 24. Various transports
  25. 25. Various transports • req.bind(‘inproc://some/pipe’) • req.bind(‘ipc://some/pipe’) • req.bind(’tcp://127.0.0.1:5555’)
  26. 26. Patterns Socket level topology
  27. 27. Request - Reply * Images by iMatrix
  28. 28. Publish - Subscribe * Images by iMatrix
  29. 29. Parallel tasks * Images by iMatrix
  30. 30. Demo
  31. 31. Scale
  32. 32. Start small * Images by iMatrix
  33. 33. Bigger * Images by iMatrix
  34. 34. And bigger... * Images by iMatrix
  35. 35. Devices Device * Images by iMatrix
  36. 36. QUEUE * Images by iMatrix
  37. 37. Demo
  38. 38. Implementation
  39. 39. Ruby-FFI Foreign Function Interface
  40. 40. Ruby-FFI
  41. 41. Ruby-FFI (Win)
  42. 42. Why FFI? •Debian: no need from *-dev • Multi-platform • Easy to read (Ruby, not C)
  43. 43. Projects http://zeromq.org/docs:labs
  44. 44. http://mongrel2.org
  45. 45. Evolution App App App HTTP HTTP HTTP Net Net Net Webrick Mongrel Thin
  46. 46. Evolution App HTTP Net Mongrel2
  47. 47. Mongrel2 Push/Pull 0mq Pub/Sub Handler Handler Responses Handler Requests
  48. 48. Demo
  49. 49. Future • Part of Linux kernel • http://www.crossroads.io/ • zerocloud ?
  50. 50. Thank you!

Hinweis der Redaktion

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

×