posix-mq-rb - command-line interface for POSIX message queues
MQUEUE=/name posix-mq-rb COMMAND [OPTIONS] [ARGUMENTS]
A command-line interface for manipulating POSIX message queues. It is useful for testing and debugging applications using POSIX message queues.
create - create a new message queue
attr - output attributes of the message queue
send - insert a message into the queue from stdin or the command-line
receive - take a message from the queue and outputs it to stdout
wait - sleep until a message is available in the queue
unlink - unlink the message queue
The create command accepts the following options:
This causes queue creation to fail if the queue exists.
The MODE to open the file under, the actual mode of the queue will be AND-ed with the current umask (like open(2)).
The maximum messages in the queue. The default and limit of this value is system-dependent. This must be specified if --msgsize is also specified.
The maximum size of an individual message. The default and limit of this value is system-dependent. This must be specified if --maxmsg is also specified.
The attr command takes no special options nor command-line arguments. The output format of this command is suitable for "eval" in shell scripts. Sample output is below:
flags=0
maxmsg=10
msgsize=8192
curmsgs=3
See mq_getattr(3) for information on the meaning of the fields.
The send command will read a message from standard input if no command-line arguments are given. If command-line arguments are given, each argument is considered its own message and will be inserted into the queue separately.
The following command-line arguments are accepted:
The receive command will output message to standard output. It will read a message from standard input if no command-line arguments are given. If command-line arguments are given, each argument is considered its own message and will be inserted into the queue separately.
The following command-line arguments are accepted:
Output the priority of the received message to stderr in the following format:
priority=3
The priority is an unsigned integer.
The wait command will cause posix-mq-rb(1) to sleep until a message is available in the queue. Only one process may wait on an empty queue, posix-mq-rb(1) will exit with an error if there is another waiting process.
It takes no arguments and accepts the following options:
The unlink command prevents further opening and use of the current queue. Existing processes with the queue open may continue to operate on the queue indefinitely. If a new queue is created with the same name, the created queue is a different queue from the unlinked queue. See mq_unlink(3) for more information.
Do not show warning/error messages, suitable for scripting.
Show summary usage
All commands rely on the MQUEUE environment variable. The value of MQUEUE should always be prefixed with a slash ("/") for portability.
Exit status is normally 0. Exit status is 2 if a timeout occurs, 1 for all other errors.
Under FreeBSD, the mq_* system calls are not available unless you load the mqueuefs(5) kernel module:
kldload mqueuefs
mail archives: https://yhbt.net/ruby-posix-mq/ http://ou63pmih66umazou.onion/ruby-posix-mq/ nntp://news.public-inbox.org/inbox.comp.lang.ruby.posix-mq nntp://ou63pmih66umazou.onion/inbox.comp.lang.ruby.posix-mq public: ruby-posix-mq@yhbt.net source code: git clone https://yhbt.net/ruby_posix_mq.git torsocks git clone http://ou63pmih66umazou.onion/ruby_posix_mq.git