Unofficial ruby_posix_mq Mirror. Updated semi-regularly.
Ruby C Makefile E Shell
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


= posix_mq - POSIX Message Queues for Ruby

POSIX message queues allow local processes to exchange data in the form
of messages.  This API is distinct from that provided by System V
message queues, but provides similar functionality.

POSIX message queues may be implemented in the kernel for fast,
low-latency communication between processes on the same machine.
POSIX message queues are not intended to replace userspace,
network-aware message queue implementations.

== Features

* Supports message notifications via signals on all platforms

* Supports portable non-blocking operation.  Under Linux 2.6.6+ and
  FreeBSD 7.2+, POSIX_MQ objects may even be used with event
  notification mechanisms such as

* Supports notifications via block execution in a separate thread
  on platforms that implement SIGEV_THREAD for mq_notify(3),
  currently only GNU/Linux.

* Optional timeouts may be applied to send and receive operations.

* Thread-safe blocking operations under Ruby 1.9+, releases GVL
  before blocking operations.

* Works under Ruby 1.9 and later.

* Documented library API

* Includes a generic "posix-mq-rb" command-line tool with manpage.

* {EventMachine}[] integration via

== Install

Operating system support (or library emulation) for POSIX message queues
is required.  Most modern GNU/Linux distributions support this

If you're using a packaged Ruby distribution, make sure you have a C
compiler and the matching Ruby development libraries and headers.

If you plan on using the command-line client, a tarball installation
starts up faster and is recommended.  Just grab the tarball from:
Unpack it, and run "ruby setup.rb"

Otherwise, via RubyGems: gem install posix_mq

== Usage

The Linux mq_overview(7)
provides a good overview of programming with POSIX message queues.

Under FreeBSD, you must load the
kernel module before attempting to use POSIX message queues:

    kldload mqueuefs

Our API matches the POSIX C API closely, see the RDoc for full API
documentation.  Here is an example of a process communicating
with itself.  In practice, processes that send will be different
from processes that receive.

    require 'posix_mq'
    mq ="/foo", :rw)

    # hello world
    mq << "hello world"
    puts mq.receive.first # => should print "hello world"

    # non-blocking operation
    mq.nonblock = true
    rescue Errno::EAGAIN

    trap(:USR1) { puts mq.receive.first }
    mq.notify = :USR1
    mq.send "fire USR1 handler"
    # "fire USR1 handler" should be printed now

== Development

You can get the latest source via git from the following locations:

	git:// (mirror)

You may also browse the code from the web:

* (gitweb)

Inline patches (from "git format-patch") to the mailing list are
preferred because they allow code review and comments in the reply to
the patch.

We will adhere to mostly the same conventions for patch submissions as
git itself.  See the Documentation/SubmittingPatches document
distributed with git on patch submission guidelines to follow:

Just don't mail the git list or maintainer with Ruby posix_mq patches.

== Contact

All feedback (bug reports, user/development discussion, patches, pull
requests) go to the mailing list:

Send patches (from "git format-patch") with "git send-email" and do not
send HTML email or attachments.  We are very responsive to email and you
will usually get a response within 24-72 hours.

Subscription is optional:

Read-only mail archives are available over HTTP and NNTP: