firemq 0.1.0-arm64-darwin
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/README.md +46 -0
- data/lib/firemq/firemq_client_ffi.rb +2075 -0
- data/lib/firemq/libfiremq_client_ffi.dylib +0 -0
- data/lib/firemq.rb +261 -0
- metadata +64 -0
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: bab63a798b7f9eec6d3540d54fb1615b744891a3cf48484cbd95b1bb5b62be73
|
|
4
|
+
data.tar.gz: b96ceeb368e2b14c8e292528472295c2ed18d68bcaf276a5bd4b13fd90b7e866
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: 1e56e0328e68876e190c4152112de0631d96ebc4dccc2320351ad84c1f1f5ee7e245722b61f4824ef74c05e950d334362f3e301ba95c26fa42a20972ca88bfdd
|
|
7
|
+
data.tar.gz: 3dba631cb7f26d6360e389f0fa8c14f538ee7b7da992eaeb5c44e8959362062f555a1f060ee1d617a19fdfc0f7498dac482ea77f44f4605341db56141fdebf53
|
data/README.md
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# firemq for Ruby
|
|
2
|
+
|
|
3
|
+
A Ruby client for [FireMQ](https://github.com/FireMQ/firemq), built on the Rust client with
|
|
4
|
+
[UniFFI](https://mozilla.github.io/uniffi-rs/).
|
|
5
|
+
|
|
6
|
+
```bash
|
|
7
|
+
gem install firemq
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
The gem includes the native library for Linux (x86-64 and arm64, glibc 2.17 or later), macOS
|
|
11
|
+
(Apple silicon and Intel, 11 or later) and Windows x64, so it needs no compiler. It needs
|
|
12
|
+
Ruby 3.1 or later.
|
|
13
|
+
|
|
14
|
+
```ruby
|
|
15
|
+
require "firemq"
|
|
16
|
+
|
|
17
|
+
FireMQ.connect("fire://guest:guest@localhost:5673") do |client|
|
|
18
|
+
client.declare_queue("jobs")
|
|
19
|
+
client.publish("", "jobs", "hello", headers: { "attempt" => 1 }, content_type: "text/plain")
|
|
20
|
+
|
|
21
|
+
client.subscribe("jobs", prefetch: 10).each do |msg|
|
|
22
|
+
puts msg.text
|
|
23
|
+
msg.ack
|
|
24
|
+
break
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
Calls block until the broker answers. Errors are subclasses of `FireMQ::Error`:
|
|
30
|
+
`ServerError` (with the AMQP reply `code`), `UnroutableError`, `NackedError`, `ClosedError`
|
|
31
|
+
and `OtherError`.
|
|
32
|
+
|
|
33
|
+
To use a library you built yourself, set `FIREMQ_LIB` to its path.
|
|
34
|
+
|
|
35
|
+
## Develop
|
|
36
|
+
|
|
37
|
+
Build the library, start a broker, then run the tests:
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
cargo build -p firemq-client-ffi
|
|
41
|
+
FIREMQ_LIB=../../target/debug/libfiremq_client_ffi.so \
|
|
42
|
+
FIREMQ_URL=fire://guest:guest@localhost:5673 \
|
|
43
|
+
bundle exec ruby -Ilib -Itest test/test_firemq.rb
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
On macOS, the library is `libfiremq_client_ffi.dylib`.
|