1 = posix_mq - POSIX message queues for Ruby
3 POSIX message queues allow local processes to exchange data in the form
4 of messages. This API is distinct from that provided by System V
5 message queues, but provides similar functionality.
7 POSIX message queues may be implemented in the kernel for fast,
8 low-latency communication between processes on the same machine.
9 POSIX message queues are not intended to replace userspace,
10 network-aware message queue implementations.
14 * Supports message notifications via signals on all platforms
16 * Supports portable non-blocking operation. Under Linux 2.6.6+ and
17 FreeBSD 7.2+, POSIX_MQ objects may even be used with event
18 notification mechanisms such as IO.select.
20 * Supports notifications via block execution in a separate thread
21 on platforms that implement SIGEV_THREAD for mq_notify(3),
22 currently only GNU/Linux.
24 * Optional timeouts may be applied to send and receive operations.
26 * Thread-safe blocking operations under Ruby 1.9+, releases GVL
27 before blocking operations.
29 * Works under Ruby 1.9 and later.
31 * Documented library API
33 * Includes a generic "posix-mq-rb" command-line tool with manpage.
35 * {EventMachine}[http://rubyeventmachine.com/] integration via
36 {em-posixmq}[https://github.com/ibc/em-posixmq]
40 Operating system support (or library emulation) for POSIX message queues
41 is required. Most modern GNU/Linux distributions support this
44 If you're using a packaged Ruby distribution, make sure you have a C
45 compiler and the matching Ruby development libraries and headers.
47 If you plan on using the command-line client, a tarball installation
48 starts up faster and is recommended. Just grab the tarball from:
50 https://bogomips.org/ruby_posix_mq/files/
51 Unpack it, and run "ruby setup.rb"
53 Otherwise, via RubyGems: gem install posix_mq
57 The Linux mq_overview(7)
58 {manpage}[http://kernel.org/doc/man-pages/online/pages/man7/mq_overview.7.html]
59 provides a good overview of programming with POSIX message queues.
61 Under FreeBSD, you must load the
62 {mqueuefs(5)}[http://freebsd.org/cgi/man.cgi?query=mqueuefs]
63 kernel module before attempting to use POSIX message queues:
67 Our API matches the POSIX C API closely, see the RDoc for full API
68 documentation. Here is an example of a process communicating
69 with itself. In practice, processes that send will be different
70 from processes that receive.
73 mq = POSIX_MQ.new("/foo", :rw)
77 puts mq.receive.first # => should print "hello world"
79 # non-blocking operation
86 trap(:USR1) { puts mq.receive.first }
88 mq.send "fire USR1 handler"
89 # "fire USR1 handler" should be printed now
93 You can get the latest source via git from the following locations:
95 git://bogomips.org/ruby_posix_mq.git
96 git://repo.or.cz/ruby_posix_mq.git (mirror)
98 You may also browse the code from the web:
100 * https://bogomips.org/ruby_posix_mq.git
101 * http://repo.or.cz/w/ruby_posix_mq.git (gitweb)
103 Inline patches (from "git format-patch") to the mailing list are
104 preferred because they allow code review and comments in the reply to
107 We will adhere to mostly the same conventions for patch submissions as
108 git itself. See the Documentation/SubmittingPatches document
109 distributed with git on patch submission guidelines to follow:
111 https://git.kernel.org/cgit/git/git.git/plain/Documentation/SubmittingPatches
113 Just don't mail the git list or maintainer with Ruby posix_mq patches.
117 All feedback (bug reports, user/development discussion, patches, pull
118 requests) go to the mailing list: mailto:ruby-posix-mq@bogomips.org
120 Send patches (from "git format-patch") with "git send-email" and do not
121 send HTML email or attachments. We are very responsive to email and you
122 will usually get a response within 24-72 hours.
124 Subscription is optional: mailto:ruby-posix-mq+subscribe@bogomips.org
126 Read-only mail archives are available over HTTPS and NNTP:
128 https://bogomips.org/ruby-posix-mq/
129 nntp://news.public-inbox.org/inbox.comp.lang.ruby.posix-mq