You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,6 +15,7 @@ The general theme of this release is performance improvement by eliminating thre
15
15
*`BeeBuilder` and `FullBuilder` are intermediate types that generally should not be instantiated directly.
16
16
*`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.
17
17
*`beekeeper::bee::Context` now takes a generic parameter that must be input type of the `Worker`.
18
+
*`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`).
18
19
* Features
19
20
* 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.
20
21
*`ChannelTaskQueues` implements the existing behavior, using a channel for sending tasks.
Copy file name to clipboardExpand all lines: README.md
+2-1Lines changed: 2 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -108,7 +108,8 @@ There are multiple methods in each group that differ by how the task results (ca
108
108
* The methods with the `_unordered` suffix instead return an unordered iterator, which may be
109
109
more performant than the ordered iterator
110
110
* The methods with the `_send` suffix accept a channel `Sender` and send the `Outcome`s to that
111
-
channel as they are completed
111
+
channel as they are completed.
112
+
* Note that, for these methods, the `tx` parameter is of type `Borrow<Sender<_>>`, which allows you to pass in either a value or a reference. Passing a value causes the `Sender` to be dropped after the call, while passing a reference allows you to use the same `Sender` for multiple `_send` calls. Note that in the later case, you need to explicitly drop the sender (e.g., `drop(tx)`), pass it by value to the last `_send` call, or be careful about how you obtain outcomes from the `Receiver` as methods such as `recv` and `iter` will block until the `Sender` is dropped. You should *not* pass clones of the `Sender` to `_send` methods as this results in slightly worse performance and still has the requirement that you manually drop the original `Sender` value.
112
113
* The methods with the `_store` suffix store the `Outcome`s in the `Hive`; these may be
113
114
retrieved later using the [`Hive::take_stored()`](https://docs.rs/beekeeper/latest/beekeeper/hive/struct.Hive.html#method.take_stored) method, using
0 commit comments