Skip to content

Commit 1895c3c

Browse files
committed
Comments about not dropping the Worker too early
1 parent f6c730c commit 1895c3c

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

effectum/src/worker.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@ struct CancellableTask {
3333
join_handle: JoinHandle<()>,
3434
}
3535

36-
/// A worker that runs jobs from the queue.
36+
/// A worker that runs jobs from the queue. Dropping a worker will disconnect it and stop running
37+
/// jobs.
3738
#[must_use = "Workers must be stored. Dropping a worker early will disconnect it from the queue."]
3839
pub struct Worker {
3940
/// The worker's internal ID.
@@ -194,7 +195,8 @@ where
194195
self
195196
}
196197

197-
/// Consume this [WorkerBuilder] and create a new [Worker].
198+
/// Consume this [WorkerBuilder] and create a new [Worker]. The Worker must be stored, as it
199+
/// will automatically disconnect from the Queue when it is dropped.
198200
pub async fn build(self) -> Result<Worker> {
199201
let job_defs: HashMap<SmartString, JobRunner<CONTEXT>> =
200202
if let Some(job_defs) = self.job_defs {

0 commit comments

Comments
 (0)