diff --git a/Cargo.lock b/Cargo.lock index b501a08..04a90e7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -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" diff --git a/Cargo.toml b/Cargo.toml index 2b29158..6b16a02 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -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"] } diff --git a/README.md b/README.md index 725c5e8..4d99d5d 100644 --- a/README.md +++ b/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(()) diff --git a/crates/nodrop/Cargo.toml b/crates/drop-queue/Cargo.toml similarity index 69% rename from crates/nodrop/Cargo.toml rename to crates/drop-queue/Cargo.toml index 336966e..969262f 100644 --- a/crates/nodrop/Cargo.toml +++ b/crates/drop-queue/Cargo.toml @@ -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 "] version.workspace = true diff --git a/crates/nodrop/src/lib.rs b/crates/drop-queue/src/lib.rs similarity index 99% rename from crates/nodrop/src/lib.rs rename to crates/drop-queue/src/lib.rs index eaa006a..6424c69 100644 --- a/crates/nodrop/src/lib.rs +++ b/crates/drop-queue/src/lib.rs @@ -160,7 +160,7 @@ mod notmad { #[async_trait] impl notmad::Component for DropQueue { fn name(&self) -> Option { - Some("nodrop/drop-queue".into()) + Some("drop-queue/drop-queue".into()) } async fn run(&self, cancellation_token: CancellationToken) -> Result<(), MadError> { diff --git a/cuddle.yaml b/cuddle.yaml index 3397f8c..54a73ac 100644 --- a/cuddle.yaml +++ b/cuddle.yaml @@ -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"