Compare commits
1 Commits
Author | SHA1 | Date | |
---|---|---|---|
41832dead4 |
13
CHANGELOG.md
13
CHANGELOG.md
@@ -6,11 +6,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
|
|
||||||
## [Unreleased]
|
## [Unreleased]
|
||||||
|
|
||||||
## [0.0.4] - 2025-08-08
|
## [0.0.2] - 2025-07-01
|
||||||
|
|
||||||
### Other
|
### Added
|
||||||
- Configure Renovate (#3)
|
- clarify readme
|
||||||
Add renovate.json
|
- set mit
|
||||||
|
- feat use mit license
|
||||||
|
|
||||||
|
|
||||||
|
### Docs
|
||||||
|
- correct
|
||||||
|
|
||||||
## [0.0.1] - 2025-07-01
|
## [0.0.1] - 2025-07-01
|
||||||
|
|
||||||
|
@@ -3,7 +3,7 @@ members = ["crates/*"]
|
|||||||
resolver = "2"
|
resolver = "2"
|
||||||
|
|
||||||
[workspace.package]
|
[workspace.package]
|
||||||
version = "0.0.4"
|
version = "0.0.2"
|
||||||
license = "MIT"
|
license = "MIT"
|
||||||
|
|
||||||
[workspace.dependencies]
|
[workspace.dependencies]
|
||||||
|
@@ -5,12 +5,6 @@ Manage concurrent tasks with optional limits, cancellation, and first-error prop
|
|||||||
|
|
||||||
Inpired by golang (errgroups)
|
Inpired by golang (errgroups)
|
||||||
|
|
||||||
## Disclaimer
|
|
||||||
|
|
||||||
The library is still new, and as such the API is subject to change, I don't expect changes to the add and wait functions, but the rest may change. I might also move to custom error types, and or removing the tokio_utils entirely to slim down the package. It shouldn't affect the user too much however.
|
|
||||||
|
|
||||||
The crate is in production, and has seen extensive use
|
|
||||||
|
|
||||||
## Features
|
## Features
|
||||||
|
|
||||||
- **Unlimited or bounded concurrency** via `with_limit(usize)`.
|
- **Unlimited or bounded concurrency** via `with_limit(usize)`.
|
||||||
@@ -110,6 +104,6 @@ See [LICENSE-MIT](LICENSE-MIT) and [LICENSE-APACHE](LICENSE-APACHE) for details.
|
|||||||
|
|
||||||
## Contribute
|
## Contribute
|
||||||
|
|
||||||
Simply create an issue here or pr https://github.com/kjuulh/noworkers.git, development happens publicly at: https://git.kjuulh.io/kjuulh/noworkers.
|
Simply create an issue here or pr https://github.com/kjuulh/noworkers.git, development happens publicly at: git.front.kjuulh.io/kjuulh/noworkers.
|
||||||
|
|
||||||
|
|
||||||
|
@@ -4,7 +4,7 @@ edition = "2024"
|
|||||||
readme = "../../README.md"
|
readme = "../../README.md"
|
||||||
version.workspace = true
|
version.workspace = true
|
||||||
license.workspace = true
|
license.workspace = true
|
||||||
repository = "https://git.kjuulh.io/kjuulh/noworkers"
|
repository = "https://git.front.kjuulh.io/kjuulh/noworkers"
|
||||||
authors = ["kjuulh <contact@kasperhermansen.com>"]
|
authors = ["kjuulh <contact@kasperhermansen.com>"]
|
||||||
description = "A small asyncronous worker pool manages thread pool limiting, cancellation and error propogation, inspired by golangs errgroup (requires tokio)"
|
description = "A small asyncronous worker pool manages thread pool limiting, cancellation and error propogation, inspired by golangs errgroup (requires tokio)"
|
||||||
|
|
||||||
|
@@ -3,24 +3,6 @@ use std::{future::Future, sync::Arc};
|
|||||||
use tokio::{sync::Mutex, task::JoinHandle};
|
use tokio::{sync::Mutex, task::JoinHandle};
|
||||||
use tokio_util::sync::CancellationToken;
|
use tokio_util::sync::CancellationToken;
|
||||||
|
|
||||||
pub mod extensions {
|
|
||||||
use crate::Workers;
|
|
||||||
|
|
||||||
pub trait WithSysLimitCpus {
|
|
||||||
fn with_limit_to_system_cpus(&mut self) -> &mut Self;
|
|
||||||
}
|
|
||||||
|
|
||||||
impl WithSysLimitCpus for Workers {
|
|
||||||
fn with_limit_to_system_cpus(&mut self) -> &mut Self {
|
|
||||||
self.with_limit(
|
|
||||||
std::thread::available_parallelism()
|
|
||||||
.expect("to be able to get system cpu info")
|
|
||||||
.into(),
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
type ErrChan = Arc<
|
type ErrChan = Arc<
|
||||||
Mutex<(
|
Mutex<(
|
||||||
Option<tokio::sync::oneshot::Sender<anyhow::Error>>,
|
Option<tokio::sync::oneshot::Sender<anyhow::Error>>,
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
# yaml-language-server: $schema=https://git.kjuulh.io/kjuulh/cuddle/raw/branch/main/schemas/base.json
|
# yaml-language-server: $schema=https://git.front.kjuulh.io/kjuulh/cuddle/raw/branch/main/schemas/base.json
|
||||||
|
|
||||||
base: "git@git.kjuulh.io:kjuulh/cuddle-rust-lib-plan.git"
|
base: "git@git.front.kjuulh.io:kjuulh/cuddle-rust-lib-plan.git"
|
||||||
|
|
||||||
vars:
|
vars:
|
||||||
service: "noworkers"
|
service: "noworkers"
|
||||||
@@ -12,6 +12,6 @@ please:
|
|||||||
repository: "noworkers"
|
repository: "noworkers"
|
||||||
branch: main
|
branch: main
|
||||||
settings:
|
settings:
|
||||||
api_url: "https://git.kjuulh.io"
|
api_url: "https://git.front.kjuulh.io"
|
||||||
actions:
|
actions:
|
||||||
rust:
|
rust:
|
||||||
|
@@ -1,3 +0,0 @@
|
|||||||
{
|
|
||||||
"$schema": "https://docs.renovatebot.com/renovate-schema.json"
|
|
||||||
}
|
|
Reference in New Issue
Block a user