You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@asyncband.apache.org by ti...@apache.org on 2026/08/31 05:57:26 UTC
(asyncband) branch finetune created (now 25e097b)
This is an automated email from the ASF dual-hosted git repository.
tisonkun pushed a change to branch finetune
in repository https://gitbox.apache.org/repos/asf/asyncband.git
at 25e097b chore: fine tune docs and code
This branch includes the following new commits:
new 25e097b chore: fine tune docs and code
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@asyncband.apache.org
For additional commands, e-mail: commits-help@asyncband.apache.org
(asyncband) 01/01: chore: fine tune docs and code
Posted by ti...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
tisonkun pushed a commit to branch finetune
in repository https://gitbox.apache.org/repos/asf/asyncband.git
commit 25e097b343c4e0086390dad0170aa1c7cb3403dc
Author: tison <wa...@gmail.com>
AuthorDate: Mon Aug 31 13:26:12 2026 +0800
chore: fine tune docs and code
Signed-off-by: tison <wa...@gmail.com>
---
CHANGELOG-OLD.md | 2 --
CHANGELOG.md | 2 --
HISTORY.md | 2 --
MIGRATE.md | 2 --
asyncband/src/barrier/mod.rs | 2 +-
asyncband/src/blocking/parker.rs | 10 +++++-----
asyncband/src/broadcast/mpmc/unbounded/mod.rs | 2 +-
asyncband/src/condvar/mod.rs | 2 +-
asyncband/src/event/mod.rs | 2 +-
asyncband/src/internal/arena.rs | 4 ++--
asyncband/src/internal/semaphore.rs | 2 +-
asyncband/src/latch/mod.rs | 2 +-
asyncband/src/lib.rs | 2 +-
asyncband/src/mutex/mod.rs | 2 +-
asyncband/src/pool/state.rs | 2 +-
asyncband/src/semaphore/mod.rs | 2 +-
asyncband/src/shutdown/mod.rs | 2 +-
asyncband/src/waitgroup/mod.rs | 2 +-
tests-integration/tests/barrier_test.rs | 2 +-
tests-integration/tests/broadcast_mpmc_unbounded_test.rs | 2 +-
tests-integration/tests/composition_test.rs | 2 +-
tests-integration/tests/condvar_test.rs | 2 +-
tests-integration/tests/lazy_cell_test.rs | 2 +-
tests-integration/tests/mutex_test.rs | 2 +-
tests-integration/tests/once_map_test.rs | 4 ++--
tests-integration/tests/pool_behavior_test.rs | 2 +-
tests-integration/tests/waitgroup_test.rs | 2 +-
27 files changed, 29 insertions(+), 37 deletions(-)
diff --git a/CHANGELOG-OLD.md b/CHANGELOG-OLD.md
index b8b3fc0..df59bd0 100644
--- a/CHANGELOG-OLD.md
+++ b/CHANGELOG-OLD.md
@@ -1,7 +1,5 @@
# Historical Changelog
-> Apache Asyncband (Incubating) is an effort undergoing incubation at the Apache Software Foundation (ASF), sponsored by the Apache Incubator PMC. Please read the [DISCLAIMER](DISCLAIMER).
-
## v0.6.7 (2026-08-13)
* Announce the upcoming `asyncband` rebrand.
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 2949716..3be44e7 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,7 +1,5 @@
# Changelog
-> Apache Asyncband (Incubating) is an effort undergoing incubation at the Apache Software Foundation (ASF), sponsored by the Apache Incubator PMC. Please read the [DISCLAIMER](DISCLAIMER).
-
All notable changes to this project will be documented in this file.
## Unreleased
diff --git a/HISTORY.md b/HISTORY.md
index 9ffeb03..020ff63 100644
--- a/HISTORY.md
+++ b/HISTORY.md
@@ -1,7 +1,5 @@
# History
-> Apache Asyncband (Incubating) is an effort undergoing incubation at the Apache Software Foundation (ASF), sponsored by the Apache Incubator PMC. Please read the [DISCLAIMER](DISCLAIMER).
-
Asyncband collects composable, runtime-agnostic concurrency building blocks informed by several existing implementations. Only components that draw on external designs or code are listed here.
- `barrier::Barrier` is inspired by [`std::sync::Barrier`](https://doc.rust-lang.org/std/sync/struct.Barrier.html) and [`tokio::sync::Barrier`](https://docs.rs/tokio/latest/tokio/sync/struct.Barrier.html), with a different implementation based on the internal `WaitSet` primitive.
diff --git a/MIGRATE.md b/MIGRATE.md
index 6486778..2b2adfc 100644
--- a/MIGRATE.md
+++ b/MIGRATE.md
@@ -1,7 +1,5 @@
# Migrating from MEA
-> Apache Asyncband (Incubating) is an effort undergoing incubation at the Apache Software Foundation (ASF), sponsored by the Apache Incubator PMC. Please read the [DISCLAIMER](DISCLAIMER).
-
Asyncband continues the codebase formerly published as [`mea`](https://crates.io/crates/mea), but it uses a new Cargo package and Rust crate name. Existing `mea` releases remain available for builds that have not migrated, but they receive no further development.
## Recommended migration path
diff --git a/asyncband/src/barrier/mod.rs b/asyncband/src/barrier/mod.rs
index 9f43625..1ee6946 100644
--- a/asyncband/src/barrier/mod.rs
+++ b/asyncband/src/barrier/mod.rs
@@ -31,7 +31,7 @@
//! use asyncband::barrier::Barrier;
//!
//! let barrier = Arc::new(Barrier::new(3));
-//! let mut tasks = Vec::new();
+//! let mut tasks = vec![];
//!
//! for _ in 0..3 {
//! let barrier = barrier.clone();
diff --git a/asyncband/src/blocking/parker.rs b/asyncband/src/blocking/parker.rs
index 97401b2..34fe1cc 100644
--- a/asyncband/src/blocking/parker.rs
+++ b/asyncband/src/blocking/parker.rs
@@ -30,7 +30,7 @@ const EMPTY: usize = 0;
const PARKED: usize = 1;
const NOTIFIED: usize = 2;
-pub(super) struct Parker {
+pub struct Parker {
state: Arc<ParkerState>,
// This marker keeps the single-waiter Parker !Sync while its waker state remains Sync.
single_waiter: PhantomData<Cell<()>>,
@@ -43,7 +43,7 @@ struct ParkerState {
}
impl Parker {
- pub(super) fn new() -> Self {
+ pub fn new() -> Self {
Self {
state: Arc::new(ParkerState {
state: AtomicUsize::new(EMPTY),
@@ -54,15 +54,15 @@ impl Parker {
}
}
- pub(super) fn park(&self) {
+ pub fn park(&self) {
self.state.park(None);
}
- pub(super) fn park_timeout(&self, timeout: Duration) {
+ pub fn park_timeout(&self, timeout: Duration) {
self.state.park(Some(timeout));
}
- pub(super) fn waker(&self) -> Waker {
+ pub fn waker(&self) -> Waker {
Waker::from(self.state.clone())
}
}
diff --git a/asyncband/src/broadcast/mpmc/unbounded/mod.rs b/asyncband/src/broadcast/mpmc/unbounded/mod.rs
index 2207d59..2924d48 100644
--- a/asyncband/src/broadcast/mpmc/unbounded/mod.rs
+++ b/asyncband/src/broadcast/mpmc/unbounded/mod.rs
@@ -220,7 +220,7 @@ impl<T> Reclaimed<T> {
fn empty() -> Self {
Self {
first: None,
- rest: Vec::new(),
+ rest: vec![],
}
}
diff --git a/asyncband/src/condvar/mod.rs b/asyncband/src/condvar/mod.rs
index ef3fb2e..4526343 100644
--- a/asyncband/src/condvar/mod.rs
+++ b/asyncband/src/condvar/mod.rs
@@ -157,7 +157,7 @@ impl Condvar {
pub fn notify_all(&self) {
let wakers = {
let mut waiters = self.waiters.lock();
- let mut wakers = Vec::new();
+ let mut wakers = vec![];
while waiters
.unlink_first_waiter(|node| {
diff --git a/asyncband/src/event/mod.rs b/asyncband/src/event/mod.rs
index 96b3ebf..fcf2308 100644
--- a/asyncband/src/event/mod.rs
+++ b/asyncband/src/event/mod.rs
@@ -171,7 +171,7 @@ impl ManualResetEvent {
state.is_set = true;
// Detach the complete cohort before invoking any waker. A wake callback may reset the
// event and register a new wait, which must belong to the state current at that point.
- let mut wakers = Vec::new();
+ let mut wakers = vec![];
while let Some((_id, waiter)) = state.waiters.unlink_first_waiter(|waiter| {
waiter.notified = true;
true
diff --git a/asyncband/src/internal/arena.rs b/asyncband/src/internal/arena.rs
index 2cb762c..ab63e63 100644
--- a/asyncband/src/internal/arena.rs
+++ b/asyncband/src/internal/arena.rs
@@ -88,7 +88,7 @@ enum Slot<T> {
impl<T> Arena<T> {
pub const fn new() -> Self {
Self {
- slots: Vec::new(),
+ slots: vec![],
next_vacant: 0,
len: 0,
}
@@ -191,7 +191,7 @@ impl<T> Arena<T> {
let len = self.len;
let mut values = ArenaValues {
first: None,
- rest: Vec::new(),
+ rest: vec![],
};
if len == 0 {
// Individually removed values leave vacant slots behind. Keep their free list intact
diff --git a/asyncband/src/internal/semaphore.rs b/asyncband/src/internal/semaphore.rs
index 3a2936d..b7827c4 100644
--- a/asyncband/src/internal/semaphore.rs
+++ b/asyncband/src/internal/semaphore.rs
@@ -202,7 +202,7 @@ impl Semaphore {
/// Adds as many permits until there is no waiter.
pub fn notify_all(&self) {
let mut waiters = self.waiters.lock();
- let mut wakers = Vec::new();
+ let mut wakers = vec![];
loop {
match waiters.unlink_first_waiter(|node| {
node.permits = 0;
diff --git a/asyncband/src/latch/mod.rs b/asyncband/src/latch/mod.rs
index 048c261..13359c9 100644
--- a/asyncband/src/latch/mod.rs
+++ b/asyncband/src/latch/mod.rs
@@ -32,7 +32,7 @@
//! use asyncband::latch::Latch;
//!
//! let latch = Arc::new(Latch::new(3));
-//! let mut tasks = Vec::new();
+//! let mut tasks = vec![];
//!
//! for _ in 0..3 {
//! let latch = latch.clone();
diff --git a/asyncband/src/lib.rs b/asyncband/src/lib.rs
index 31039bc..c17a8f4 100644
--- a/asyncband/src/lib.rs
+++ b/asyncband/src/lib.rs
@@ -112,7 +112,7 @@
//! Foundation (ASF), sponsored by the Apache Incubator PMC.
//!
//! Incubation is required of all newly accepted projects until a further review indicates that the
-//! infrastructure, communications, and decision making process have stabilized in a manner
+//! infrastructure, communications, and decision-making process have stabilized in a manner
//! consistent with other successful ASF projects.
//!
//! While incubation status is not necessarily a reflection of the completeness or stability of the
diff --git a/asyncband/src/mutex/mod.rs b/asyncband/src/mutex/mod.rs
index 0bcc72f..e1e4934 100644
--- a/asyncband/src/mutex/mod.rs
+++ b/asyncband/src/mutex/mod.rs
@@ -35,7 +35,7 @@
//! use asyncband::mutex::Mutex;
//!
//! let mutex = Arc::new(Mutex::new(0));
-//! let mut handles = Vec::new();
+//! let mut handles = vec![];
//!
//! for i in 0..3 {
//! let mutex = mutex.clone();
diff --git a/asyncband/src/pool/state.rs b/asyncband/src/pool/state.rs
index fc53614..ab8670c 100644
--- a/asyncband/src/pool/state.rs
+++ b/asyncband/src/pool/state.rs
@@ -118,7 +118,7 @@ impl<T> PoolState<T> {
}
let removed = if current == retained {
- Vec::new()
+ vec![]
} else {
self.idle
.split_off(retained)
diff --git a/asyncband/src/semaphore/mod.rs b/asyncband/src/semaphore/mod.rs
index 764561b..bdade25 100644
--- a/asyncband/src/semaphore/mod.rs
+++ b/asyncband/src/semaphore/mod.rs
@@ -293,7 +293,7 @@ impl Semaphore {
/// use asyncband::semaphore::Semaphore;
///
/// let sem = Arc::new(Semaphore::new(3));
- /// let mut join_handles = Vec::new();
+ /// let mut join_handles = vec![];
///
/// for _ in 0..5 {
/// let permit = sem.clone().acquire_owned(1).await;
diff --git a/asyncband/src/shutdown/mod.rs b/asyncband/src/shutdown/mod.rs
index faae3f5..f530750 100644
--- a/asyncband/src/shutdown/mod.rs
+++ b/asyncband/src/shutdown/mod.rs
@@ -39,7 +39,7 @@
//! # #[tokio::main]
//! # async fn main() {
//! let (shutdown, guard) = asyncband::shutdown::new();
-//! let mut tasks = Vec::new();
+//! let mut tasks = vec![];
//!
//! for _ in 0..3 {
//! let guard = guard.clone();
diff --git a/asyncband/src/waitgroup/mod.rs b/asyncband/src/waitgroup/mod.rs
index 1e08255..7dd86e1 100644
--- a/asyncband/src/waitgroup/mod.rs
+++ b/asyncband/src/waitgroup/mod.rs
@@ -31,7 +31,7 @@
//! async fn do_work() {}
//!
//! let group = WaitGroup::new();
-//! let mut tasks = Vec::new();
+//! let mut tasks = vec![];
//!
//! for _ in 0..3 {
//! let worker = group.clone();
diff --git a/tests-integration/tests/barrier_test.rs b/tests-integration/tests/barrier_test.rs
index c3a1c7b..12b2300 100644
--- a/tests-integration/tests/barrier_test.rs
+++ b/tests-integration/tests/barrier_test.rs
@@ -87,7 +87,7 @@ fn lots() {
let b = Barrier::new(100);
for _ in 0..10 {
- let mut wait = Vec::new();
+ let mut wait = vec![];
for _ in 0..99 {
let mut f = spawn(b.wait());
assert_pending!(f.poll());
diff --git a/tests-integration/tests/broadcast_mpmc_unbounded_test.rs b/tests-integration/tests/broadcast_mpmc_unbounded_test.rs
index 8469ab9..f104e8b 100644
--- a/tests-integration/tests/broadcast_mpmc_unbounded_test.rs
+++ b/tests-integration/tests/broadcast_mpmc_unbounded_test.rs
@@ -512,7 +512,7 @@ fn concurrent_senders_deliver_every_message_to_every_receiver() {
.into_iter()
.map(|mut receiver| {
thread::spawn(move || {
- let mut seen = Vec::new();
+ let mut seen = vec![];
while let Ok(value) = pollster::block_on(receiver.recv()) {
seen.push(value);
}
diff --git a/tests-integration/tests/composition_test.rs b/tests-integration/tests/composition_test.rs
index b7de067..64ac539 100644
--- a/tests-integration/tests/composition_test.rs
+++ b/tests-integration/tests/composition_test.rs
@@ -27,7 +27,7 @@ use asyncband::oneshot;
#[tokio::test(flavor = "multi_thread", worker_threads = 2)]
async fn public_primitives_compose_across_modules() {
let barrier = Arc::new(Barrier::new(3));
- let values = Arc::new(Mutex::new(Vec::new()));
+ let values = Arc::new(Mutex::new(vec![]));
let (done_tx, done_rx) = oneshot::channel();
let first_barrier = barrier.clone();
diff --git a/tests-integration/tests/condvar_test.rs b/tests-integration/tests/condvar_test.rs
index 663993c..45c336a 100644
--- a/tests-integration/tests/condvar_test.rs
+++ b/tests-integration/tests/condvar_test.rs
@@ -113,7 +113,7 @@ fn notify_all_wakes_current_waiters_using_a_predicate_loop() {
}
let pair = Arc::new((Mutex::new(State::default()), Condvar::new()));
- let mut tasks: Vec<JoinHandle<()>> = Vec::new();
+ let mut tasks: Vec<JoinHandle<()>> = vec![];
for _ in 0..WAITERS {
let pair = pair.clone();
diff --git a/tests-integration/tests/lazy_cell_test.rs b/tests-integration/tests/lazy_cell_test.rs
index 77a5e14..2604602 100644
--- a/tests-integration/tests/lazy_cell_test.rs
+++ b/tests-integration/tests/lazy_cell_test.rs
@@ -67,7 +67,7 @@ async fn concurrent_force_runs_initializer_once() {
}
}));
- let mut tasks = Vec::new();
+ let mut tasks = vec![];
for _ in 0..32 {
let lazy = lazy.clone();
tasks.push(tokio::spawn(async move { *LazyCell::force(&lazy).await }));
diff --git a/tests-integration/tests/mutex_test.rs b/tests-integration/tests/mutex_test.rs
index 7f7e27f..41c332d 100644
--- a/tests-integration/tests/mutex_test.rs
+++ b/tests-integration/tests/mutex_test.rs
@@ -167,7 +167,7 @@ async fn test_multiple_map_operations() {
#[tokio::test]
async fn test_stress() {
let mutex = Arc::new(Mutex::new(0));
- let mut handles = Vec::new();
+ let mut handles = vec![];
// Create many concurrent tasks
for i in 0..1000 {
diff --git a/tests-integration/tests/once_map_test.rs b/tests-integration/tests/once_map_test.rs
index ef0cf3d..50cc61f 100644
--- a/tests-integration/tests/once_map_test.rs
+++ b/tests-integration/tests/once_map_test.rs
@@ -62,7 +62,7 @@ async fn concurrent_compute_runs_once() {
});
started_rx.await.unwrap();
- let mut waiters = Vec::new();
+ let mut waiters = vec![];
for _ in 0..9 {
let map = map.clone();
let count = count.clone();
@@ -86,7 +86,7 @@ async fn concurrent_compute_runs_once() {
#[tokio::test(flavor = "multi_thread", worker_threads = 4)]
async fn concurrent_growth_keeps_every_entry() {
let map = Arc::new(OnceMap::new());
- let mut workers = Vec::new();
+ let mut workers = vec![];
for worker in 0..8 {
let map = Arc::clone(&map);
workers.push(tokio::spawn(async move {
diff --git a/tests-integration/tests/pool_behavior_test.rs b/tests-integration/tests/pool_behavior_test.rs
index 3ea95a8..bcbc7ad 100644
--- a/tests-integration/tests/pool_behavior_test.rs
+++ b/tests-integration/tests/pool_behavior_test.rs
@@ -113,7 +113,7 @@ async fn retain_invokes_detachment_hook_once_per_removed_object() {
},
);
- let mut objects = Vec::new();
+ let mut objects = vec![];
for _ in 0..4 {
objects.push(pool.get().await.unwrap());
}
diff --git a/tests-integration/tests/waitgroup_test.rs b/tests-integration/tests/waitgroup_test.rs
index 970db9d..c5d77ba 100644
--- a/tests-integration/tests/waitgroup_test.rs
+++ b/tests-integration/tests/waitgroup_test.rs
@@ -23,7 +23,7 @@ use tests_integration::poll_once;
#[tokio::test(flavor = "multi_thread", worker_threads = 4)]
async fn waits_for_all_worker_handles() {
let wg = WaitGroup::new();
- let mut tasks = Vec::new();
+ let mut tasks = vec![];
for _ in 0..100 {
let worker = wg.clone();
tasks.push(tokio::spawn(async move {
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@asyncband.apache.org
For additional commands, e-mail: commits-help@asyncband.apache.org