about summary refs log tree commit diff
path: root/ops/posix_mq.rs/README.md
diff options
context:
space:
mode:
authorVincent Ambo <tazjin@google.com>2020-01-20T11·32+0000
committerVincent Ambo <tazjin@google.com>2020-01-20T11·32+0000
commitb59c7e693c21cf76619ad89ae008d92ebbb92dad (patch)
treef69699cd9071832f03001af5511788b2159f04c1 /ops/posix_mq.rs/README.md
parent8f684972695aeb64d1c09499bb14c5cd65bafd91 (diff)
parentf7d1a38da67e92e0e87dbb988d288f0be2714f5c (diff)
Add 'ops/posix_mq.rs/' from commit 'f7d1a38da67e92e0e87dbb988d288f0be2714f5c' r/429
git-subtree-dir: ops/posix_mq.rs
git-subtree-mainline: 8f684972695aeb64d1c09499bb14c5cd65bafd91
git-subtree-split: f7d1a38da67e92e0e87dbb988d288f0be2714f5c
Diffstat (limited to 'ops/posix_mq.rs/README.md')
-rw-r--r--ops/posix_mq.rs/README.md33
1 files changed, 33 insertions, 0 deletions
diff --git a/ops/posix_mq.rs/README.md b/ops/posix_mq.rs/README.md
new file mode 100644
index 000000000000..9370c6c08740
--- /dev/null
+++ b/ops/posix_mq.rs/README.md
@@ -0,0 +1,33 @@
+posix_mq
+========
+
+[![Build Status](https://travis-ci.org/aprilabank/posix_mq.rs.svg?branch=master)](https://travis-ci.org/aprilabank/posix_mq.rs)
+[![crates.io](https://img.shields.io/crates/v/posix_mq.svg)](https://crates.io/crates/posix_mq)
+
+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:
+
+```rust
+// 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");
+```
+
+[message queue API]: https://linux.die.net/man/7/mq_overview
+[sister library]: https://github.com/aprilabank/posix_mq.kt