Compare commits
4 Commits
v0.0.2
...
098e34915c
Author | SHA1 | Date | |
---|---|---|---|
|
098e34915c | ||
9fb20eb5d4
|
|||
ca0eaa2492 | |||
0c33863c1d
|
10
CHANGELOG.md
10
CHANGELOG.md
@@ -6,6 +6,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
|
|
||||||
## [Unreleased]
|
## [Unreleased]
|
||||||
|
|
||||||
|
## [0.0.4] - 2025-07-22
|
||||||
|
|
||||||
|
### Added
|
||||||
|
- add readme
|
||||||
|
|
||||||
|
## [0.0.3] - 2025-07-22
|
||||||
|
|
||||||
|
### Added
|
||||||
|
- rename
|
||||||
|
|
||||||
## [0.0.2] - 2025-07-22
|
## [0.0.2] - 2025-07-22
|
||||||
|
|
||||||
### Docs
|
### Docs
|
||||||
|
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"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "9555578bc9e57714c812a1f84e4fc5b4d21fcb063490c624de019f7464c91268"
|
checksum = "9555578bc9e57714c812a1f84e4fc5b4d21fcb063490c624de019f7464c91268"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "drop-queue"
|
||||||
|
version = "0.0.3"
|
||||||
|
dependencies = [
|
||||||
|
"anyhow",
|
||||||
|
"async-trait",
|
||||||
|
"notmad",
|
||||||
|
"tokio",
|
||||||
|
"tokio-util",
|
||||||
|
"tracing",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "futures"
|
name = "futures"
|
||||||
version = "0.3.31"
|
version = "0.3.31"
|
||||||
@@ -239,18 +251,6 @@ dependencies = [
|
|||||||
"windows-sys 0.59.0",
|
"windows-sys 0.59.0",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "nodrop"
|
|
||||||
version = "0.1.0"
|
|
||||||
dependencies = [
|
|
||||||
"anyhow",
|
|
||||||
"async-trait",
|
|
||||||
"notmad",
|
|
||||||
"tokio",
|
|
||||||
"tokio-util",
|
|
||||||
"tracing",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "notmad"
|
name = "notmad"
|
||||||
version = "0.7.2"
|
version = "0.7.2"
|
||||||
|
@@ -3,10 +3,10 @@ members = ["crates/*"]
|
|||||||
resolver = "2"
|
resolver = "2"
|
||||||
|
|
||||||
[workspace.package]
|
[workspace.package]
|
||||||
version = "0.0.2"
|
version = "0.0.4"
|
||||||
|
|
||||||
[workspace.dependencies]
|
[workspace.dependencies]
|
||||||
nodrop = { path = "crates/nodrop" }
|
drop-queue = { path = "crates/drop-queue" }
|
||||||
|
|
||||||
anyhow = { version = "1" }
|
anyhow = { version = "1" }
|
||||||
tokio = { version = "1", features = ["full"] }
|
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.
|
> 💡 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
|
```toml
|
||||||
[dependencies]
|
[dependencies]
|
||||||
nodrop = "*"
|
drop-queue = "*"
|
||||||
```
|
```
|
||||||
|
|
||||||
### Enable `notmad` integration (optional)
|
### Enable `notmad` integration (optional)
|
||||||
|
|
||||||
```toml
|
```toml
|
||||||
[dependencies]
|
[dependencies]
|
||||||
nodrop = { version = "*", features = ["notmad"] }
|
drop-queue = { version = "*", features = ["notmad"] }
|
||||||
```
|
```
|
||||||
|
|
||||||
---
|
---
|
||||||
@@ -37,7 +37,7 @@ nodrop = { version = "*", features = ["notmad"] }
|
|||||||
## 🛠 Example
|
## 🛠 Example
|
||||||
|
|
||||||
```rust
|
```rust
|
||||||
use nodrop::DropQueue;
|
use drop-queue::DropQueue;
|
||||||
use tokio::sync::oneshot;
|
use tokio::sync::oneshot;
|
||||||
|
|
||||||
#[tokio::main]
|
#[tokio::main]
|
||||||
@@ -69,7 +69,7 @@ If using the [`notmad`](https://crates.io/crates/notmad) lifecycle framework:
|
|||||||
```rust
|
```rust
|
||||||
#[tokio::main]
|
#[tokio::main]
|
||||||
async fn main() -> anyhow::Result<()> {
|
async fn main() -> anyhow::Result<()> {
|
||||||
let queue = nodrop::DropQueue::new();
|
let queue = drop-queue::DropQueue::new();
|
||||||
let app = notmad::Mad::new().add(queue);
|
let app = notmad::Mad::new().add(queue);
|
||||||
app.run().await?;
|
app.run().await?;
|
||||||
Ok(())
|
Ok(())
|
||||||
|
@@ -1,10 +1,11 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "nodrop"
|
name = "drop-queue"
|
||||||
edition = "2024"
|
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"
|
license = "MIT"
|
||||||
repository = "https://github.com/kjuulh/nodrop"
|
repository = "https://github.com/kjuulh/drop-queue"
|
||||||
authors = ["kjuulh <contact@kasperhermansen.com>"]
|
authors = ["kjuulh <contact@kasperhermansen.com>"]
|
||||||
|
readme = "./../../README.md"
|
||||||
|
|
||||||
version.workspace = true
|
version.workspace = true
|
||||||
|
|
@@ -160,7 +160,7 @@ mod notmad {
|
|||||||
#[async_trait]
|
#[async_trait]
|
||||||
impl notmad::Component for DropQueue {
|
impl notmad::Component for DropQueue {
|
||||||
fn name(&self) -> Option<String> {
|
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> {
|
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"
|
base: "git@git.front.kjuulh.io:kjuulh/cuddle-rust-lib-plan.git"
|
||||||
|
|
||||||
vars:
|
vars:
|
||||||
service: "nodrop"
|
service: "drop-queue"
|
||||||
registry: kasperhermansen
|
registry: kasperhermansen
|
||||||
|
|
||||||
please:
|
please:
|
||||||
project:
|
project:
|
||||||
owner: kjuulh
|
owner: kjuulh
|
||||||
repository: "nodrop"
|
repository: "drop-queue"
|
||||||
branch: main
|
branch: main
|
||||||
settings:
|
settings:
|
||||||
api_url: "https://git.front.kjuulh.io"
|
api_url: "https://git.front.kjuulh.io"
|
||||||
|
Reference in New Issue
Block a user