This commit is contained in:
24
Cargo.lock
generated
24
Cargo.lock
generated
@@ -73,6 +73,18 @@ version = "1.0.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "9555578bc9e57714c812a1f84e4fc5b4d21fcb063490c624de019f7464c91268"
|
||||
|
||||
[[package]]
|
||||
name = "drop-queue"
|
||||
version = "0.0.1"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"async-trait",
|
||||
"notmad",
|
||||
"tokio",
|
||||
"tokio-util",
|
||||
"tracing",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "futures"
|
||||
version = "0.3.31"
|
||||
@@ -239,18 +251,6 @@ dependencies = [
|
||||
"windows-sys 0.59.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "nodrop"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"async-trait",
|
||||
"notmad",
|
||||
"tokio",
|
||||
"tokio-util",
|
||||
"tracing",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "notmad"
|
||||
version = "0.7.2"
|
||||
|
@@ -6,7 +6,7 @@ resolver = "2"
|
||||
version = "0.0.2"
|
||||
|
||||
[workspace.dependencies]
|
||||
nodrop = { path = "crates/nodrop" }
|
||||
drop-queue = { path = "crates/drop-queue" }
|
||||
|
||||
anyhow = { version = "1" }
|
||||
tokio = { version = "1", features = ["full"] }
|
||||
|
12
README.md
12
README.md
@@ -1,6 +1,6 @@
|
||||
# 🧊 nodrop
|
||||
# 🧊 drop-queue
|
||||
|
||||
**`nodrop`** is a simple, composable async drop queue for Rust — built to run queued tasks in FIFO order and ensure graceful shutdown via draining. It's useful in lifecycle-managed environments (e.g., `notmad`) or as a lightweight alternative until async drop is stabilized in Rust.
|
||||
**`drop-queue`** is a simple, composable async drop queue for Rust — built to run queued tasks in FIFO order and ensure graceful shutdown via draining. It's useful in lifecycle-managed environments (e.g., `notmad`) or as a lightweight alternative until async drop is stabilized in Rust.
|
||||
|
||||
> 💡 Tasks are executed one at a time. If the queue is marked for draining, no further items can be added.
|
||||
|
||||
@@ -22,14 +22,14 @@
|
||||
|
||||
```toml
|
||||
[dependencies]
|
||||
nodrop = "*"
|
||||
drop-queue = "*"
|
||||
```
|
||||
|
||||
### Enable `notmad` integration (optional)
|
||||
|
||||
```toml
|
||||
[dependencies]
|
||||
nodrop = { version = "*", features = ["notmad"] }
|
||||
drop-queue = { version = "*", features = ["notmad"] }
|
||||
```
|
||||
|
||||
---
|
||||
@@ -37,7 +37,7 @@ nodrop = { version = "*", features = ["notmad"] }
|
||||
## 🛠 Example
|
||||
|
||||
```rust
|
||||
use nodrop::DropQueue;
|
||||
use drop-queue::DropQueue;
|
||||
use tokio::sync::oneshot;
|
||||
|
||||
#[tokio::main]
|
||||
@@ -69,7 +69,7 @@ If using the [`notmad`](https://crates.io/crates/notmad) lifecycle framework:
|
||||
```rust
|
||||
#[tokio::main]
|
||||
async fn main() -> anyhow::Result<()> {
|
||||
let queue = nodrop::DropQueue::new();
|
||||
let queue = drop-queue::DropQueue::new();
|
||||
let app = notmad::Mad::new().add(queue);
|
||||
app.run().await?;
|
||||
Ok(())
|
||||
|
@@ -1,9 +1,9 @@
|
||||
[package]
|
||||
name = "nodrop"
|
||||
name = "drop-queue"
|
||||
edition = "2024"
|
||||
description = "nodrop, is a simple drop queue system for async operations. (Until async-drop is a thing)"
|
||||
description = "drop-queue, is a simple drop queue system for async operations. (Until async-drop is a thing)"
|
||||
license = "MIT"
|
||||
repository = "https://github.com/kjuulh/nodrop"
|
||||
repository = "https://github.com/kjuulh/drop-queue"
|
||||
authors = ["kjuulh <contact@kasperhermansen.com>"]
|
||||
|
||||
version.workspace = true
|
@@ -160,7 +160,7 @@ mod notmad {
|
||||
#[async_trait]
|
||||
impl notmad::Component for DropQueue {
|
||||
fn name(&self) -> Option<String> {
|
||||
Some("nodrop/drop-queue".into())
|
||||
Some("drop-queue/drop-queue".into())
|
||||
}
|
||||
|
||||
async fn run(&self, cancellation_token: CancellationToken) -> Result<(), MadError> {
|
@@ -3,13 +3,13 @@
|
||||
base: "git@git.front.kjuulh.io:kjuulh/cuddle-rust-lib-plan.git"
|
||||
|
||||
vars:
|
||||
service: "nodrop"
|
||||
service: "drop-queue"
|
||||
registry: kasperhermansen
|
||||
|
||||
please:
|
||||
project:
|
||||
owner: kjuulh
|
||||
repository: "nodrop"
|
||||
repository: "drop-queue"
|
||||
branch: main
|
||||
settings:
|
||||
api_url: "https://git.front.kjuulh.io"
|
||||
|
Reference in New Issue
Block a user