diff --git a/README.md b/README.md index 9cd1e30..a2ac7b3 100644 --- a/README.md +++ b/README.md @@ -47,13 +47,30 @@ bunbun-worker = { git = "https://git.4o1x5.dev/4o1x5/bunbun-worker", branch = "m ## Usage -Here is a basic implementation of an RPC job in bunbun-worker +### Message versioning + +In this crate message versioning is done by including `v1.0.0` or such on the end of the queue name, instead of including it in the headers of a message. This reduces the amount of redelivered messages. +The following example will send a job to a queue named `emailjob-v1.0.0`. + +```rust +let result = client + .rpc_call::( + EmailJob { + send_to: "someone".into(), + contents: "something".into(), + }, + BasicCallOptions::default("emailjob") + .timeout(Duration::from_secs(3)) + .message_version("v1.0.0") + ) + .await + .unwrap(); +``` # Limitations 1. Currently some `unwrap()`'s are called inside the code and may results in panics (not in the job-runner). -2. No settings, and very limited API -3. The rabbitmq RPC logic is very basic with no message-versioning (aside using different queue names (eg service-class-v1.0.0) ) +2. limited API # Bugs department