Skip to content

Commit 7d6ac3f

Browse files
authored
chore: release v0.3.1 (#25)
## 🤖 New release * `beekeeper`: 0.3.0 -> 0.3.1 (✓ API compatible changes) <details><summary><i><b>Changelog</b></i></summary><p> <blockquote> ## 0.3.0 The general theme of this release is performance improvement by eliminating thread contention due to unnecessary locking of shared state. This required making some breaking changes to the API. * **Breaking** * `beekeeper::hive::Hive` type signature has changed * Removed the `W: Worker` parameter as it is redundant (can be obtained from `Q::Kind`) * Added `T: TaskQueues`to specify the `TaskQueues` implementation * The `Builder` interface has been re-written to enable maximum flexibility. * `Builder` is now a trait that must be in scope. * `ChannelBuilder` implements the previous builder functionality. * `WorkstealingBuilder` is identical to `ChannelBuilder`, except that it uses workstealing-based task queues (see `Features` below). * `OpenBuilder` has no type parameters and can be specialized to create a `Hive` with any combination of `Queen` and `TaskQueues`. * `BeeBuilder` and `FullBuilder` are intermediate types that generally should not be instantiated directly. * `beekeeper::bee::Queen::create` now takes `&self` rather than `&mut self`. There is a new type, `beekeeper::bee::QueenMut`, with a `create(&mut self)` method, and needs to be wrapped in a `beekeeper::bee::QueenCell` to implement the `Queen` trait. This enables the `Hive` to create new workers without locking in the case of a `Queen` that does not need mutable state. * `beekeeper::bee::Context` now takes a generic parameter that must be input type of the `Worker`. * `beekeeper::hive::Hive::try_into_husk` now has an `urgent` parameter to indicate whether queued tasks should be abandoned when shutting down the hive (`true`) or if they should be allowed to finish processing (`false`). * The type of `attempt` and `max_retries` has been changed to `u8`. This reduces memory usage and should still allow for the majority of use cases. * The `::of` methods have been removed from stock `Worker`s in favor of implementing `From`. * Features * Added the `TaskQueues` trait, which enables `Hive` to be specialized for different implementations of global (i.e., sending tasks from the `Hive` to worker threads) and local (i.e., worker thread-specific) queues. * `ChannelTaskQueues` implements the existing behavior, using a channel for sending tasks. * `WorkstealingTaskQueues` has been added to implement the workstealing pattern, based on `crossbeam::dequeue`. * Added the `local-batch` feature, which enables worker threads to queue up batches of tasks locally, which can alleviate contention between threads in the pool, especially when there are many short-lived tasks. * When this feature is enabled, tasks can be optionally weighted (by wrapping each input in `crate::hive::Weighted`) to help evenly distribute tasks with variable processing times. * Enabling this feature should be transparent (i.e., not break existing code), and the `Hive`'s task submission methods support both weighted and unweighted inputs (due to the blanket implementation of `From<T> for Weighted<T>`); however, there are some cases where it is now necessary to specify the input type where before it could be elided. * Added the `Context::submit` method, which enables tasks to submit new tasks to the `Hive`. * Other * Switched to using thread-local retry queues for the implementation of the `retry` feature, to reduce thread-contention. * Switched to storing `Outcome`s in the hive using a data structure that does not require locking when inserting, which should reduce thread contention when using `*_store` operations. * Switched to using `crossbeam_channel` for the task input channel in `ChannelTaskQueues`. These are multi-produer, multi-consumer channels (mpmc; as opposed to `std::mpsc`, which is single-consumer), which means it is no longer necessary for worker threads to aquire a Mutex lock on the channel receiver when getting tasks. * Added the `beekeeper::hive::mock` module, which has a `MockTaskRunner` for `apply`ing a worker in a mock context. This is useful for testing your `Worker`. * Updated to `2024` edition and Rust version `1.85` </blockquote> </p></details> --- This PR was generated with [release-plz](https://github.com/release-plz/release-plz/).
1 parent 5af05ad commit 7d6ac3f

2 files changed

Lines changed: 17 additions & 1 deletion

File tree

CHANGELOG.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
# Changelog
2+
3+
All notable changes to this project will be documented in this file.
4+
5+
6+
### Bug Fixes
7+
8+
- Satisfy mismatched_lifetime_syntaxes in spawn_results ([#13](https://github.com/jdidion/beekeeper/pull/13))
9+
10+
### Miscellaneous Tasks
11+
12+
- Add .omc/ to .gitignore ([#11](https://github.com/jdidion/beekeeper/pull/11))
13+
- Align with rust-template (additive) ([#12](https://github.com/jdidion/beekeeper/pull/12))
14+
- Fix release-plz with crates.io trusted publishing ([#24](https://github.com/jdidion/beekeeper/pull/24))
15+
16+
<!-- generated by git-cliff -->
117
# Beekeeper changelog
218

319
## 0.3.0

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "beekeeper"
33
description = "A full-featured worker pool library for parallelizing tasks"
4-
version = "0.3.0"
4+
version = "0.3.1"
55
edition = "2024"
66
rust-version = "1.85"
77
authors = ["John Didion <github@didion.net>"]

0 commit comments

Comments
 (0)