Date | Commit message (Collapse) |
|
There is one backwards-incompatible API change:
POSIX_MQ#send returns +true+ on success instead of +nil+
for consistency with POSIX_MQ#trysend.
This release adds the POSIX_MQ#trysend, POSIX_MQ#tryreceive and
POSIX_MQ#tryshift interfaces to avoid exceptions on common
EAGAIN errors for users of non-blocking queues.
Bugfixes: non-blocking behavior changes to a shared descriptor
in a different process are reflected immediately in the child
(this won't fix race conditions in your code, however).
Minor bugfixes for posix-mq-rb(1) and quieted warnings for
1.9.3dev.
|
|
So private we won't mention them in the commit message!
|
|
Something I considered but decided wasn't worth doing.
|
|
This is to be consistent with POSIX_MQ#trysend
|
|
Consider them good enough for a 1.0.0 release
|
|
In case somebody made the receiving pipe non-blocking,
we want the command-line tool to succeed.
|
|
Cleaner code anyways.
|
|
Avoids warnings this way
|
|
But they'll be pushed to the site for greater
visibility.
|
|
Remove the VERSION constant, it's cruft.
|
|
Oops
|
|
These are kinder and less exceptional than their
non-trying counterparts as generating exceptions
is expensive for common EAGAIN errors.
|
|
It can be local variable
|
|
It could work...
|
|
Oops :x
|
|
It's only available when compiled with libffi.
|
|
These flags can be changed in the parent or child
process, so we will always have to run mq_getattr()
to check it. This removes the GVL-keeping non-blocking
optimizations but we'll gain some soon.
|
|
|
|
DL in Ruby 1.9 isn't the same
|
|
This release now works for systems other than Linux and FreeBSD
that support POSIX message queues. This is usable for systems
without mq_timedsend() or mq_timedreceive() but with the
non-timed variants (timeouts wont work).
Thanks to Tadeusz Bochan for testing.
Ruby posix_mq is now dual-licensed under the GPLv2 (as well as the
preferred LGPLv3) for compatibility with existing GPLv2-only code.
|
|
|
|
For completeness, the LGPLv3 remains the preferred license.
|
|
Maybe people will just upgrade to newer systems eventually.
|
|
If it's not clear, we hate HTML.
|
|
ref: http://mid.gmane.org/AANLkTimNcWKqNSbD5GL76Z9rS3Gfi3uGusPksD2Eo+=P@mail.gmail.com
|
|
POSIX_MQ#notify(&block) mostly sucks.
|
|
No need to waste indentation and make eyes wander.
|
|
Some systems without mq_timedsend/mq_timedreceive need to
use alarm() or similar (setitimer()) to interrupt timed-out
mq_send/mq_receive calls, so we need to handle EINTR properly.
|
|
While the old URLs still work, bogomips.org went on a URL diet
|
|
These cannot be cast to void since its value is
meaningful.
|
|
Not all systems can convert POSIX_MQ to IO objects.
|
|
This makes us explicitly compatible with GPLv2-only programs.
|
|
Some ancient systems don't support mq_timedsend and
mq_timedreceive but somehow manage to support other POSIX
mq_* functions.
|
|
It's all standard C library stuff.
|
|
RSTRING_PTR may contain '\0' bytes which makes it unsuitable
for mq_unlink() and mq_open()
|
|
This was too aggressively deleted during cleanups for Rubinius
support in commit 5339d9d693c794c0f20270d5726cb360e31dff30
Noticed-by: Tadeusz Bochan <tad.bochan@bnpparibas.com>
ref: 2a92695fc1958e0370782284c6196625@ruby-forum.com
|
|
Apparently there are OSes that don't have methods to convert
mqd_t to FD.
Noticed-by: Tadeusz Bochan <tad.bochan@bnpparibas.com>
ref: <2a92695fc1958e0370782284c6196625@ruby-forum.com>
|
|
I can't stand Rake :x
|
|
Run it by default on releases.
|
|
Rubinius 1.2 as well as Ruby 1.9. Ruby 1.8 works except it will
block the entire interpreter for blocking operations. Spurious
errors during GC for POSIX_MQ#to_io users are now avoided.
|
|
No more JavaScript on our site!
|
|
Cleaner code, too, no more direct RSTRUCT usage.
|
|
StringValuePtr should already be a sufficient guard.
There are more tests while we're at it, too, and we'll
now raise TypeError instead of ArgumentError when a
POSIX_MQ::Attr is not passed properly.
|
|
This function isn't exported in the standard Ruby headers,
it returns an aggregate value and isn't available in Rubinius,
either, so nuke it.
While we're at it, use clock_gettime() instead of gettimeofday()
to avoid unnecessary timeval usage since mq_send/mq_receive
rely on higher-precision timespecs instead.
|
|
I did not know about this method back in the day...
|
|
We shouldn't unnecessarily hog system resources.
|
|
It can be dangerous to hit (and ignore) EBADF errors in
multi-threaded applications. Users of POSIX_MQ#to_io have two
Ruby objects pointing to the same file descriptor, making
things tricky when it comes time to reap resources.
We'll always prefer to close the Ruby IO object if it exists
(because we have less control over its GC behavior) and
ignore the raw descriptor.
|
|
On ENOMEM, EMFILE, and ENFILE errors, it is customary to
invoke the Ruby GC and free up resources and retry the
system call.
|
|
Fix POSIX_MQ#notify(&block) usage, this regression was
introduced in 0.4.0 and our tests for it were broken, as well.
|
|
tests for them were stupidly broken and never executed :x
|