6 releases (1 stable)

Uses old Rust 2015

3771.0.0 Feb 5, 2022
0.9.0 Jan 20, 2020
0.1.3 May 3, 2018
0.1.2 Oct 20, 2017

#712 in Unix APIs

40 downloads per month
Used in mq_cli

MIT license

17KB
259 lines

posix_mq

crates.io

This is a simple, relatively high-level library for the POSIX message queue API. It wraps the lower-level API in a simpler interface with more robust error handling.

Check out this project's sister library in Kotlin.

Usage example:

// Values that need to undergo validation are wrapped in safe types:
let name = Name::new("/test-queue").unwrap();

// Queue creation with system defaults is simple:
let queue = Queue::open_or_create(name).expect("Opening queue failed");

// Sending a message:
let message = Message {
  data: "test-message".as_bytes().to_vec(),
  priority: 0,
};
queue.send(&message).expect("message sending failed");

// ... and receiving it!
let result = queue.receive().expect("message receiving failed");

Development

Development happens in the TVL monorepo.

Starting from version 3771.0.0, the version numbers correspond to revisions of the TVL repository, available as git refs (e.g. refs/r/3771).

See the TVL documentation for more information about how to contribute to the codebase.

Dependencies

~1.5MB
~36K SLoC