Skip to main content

wrap_join

Function wrap_join 

Source
pub fn wrap_join<F, Fut>(inner: Box<dyn Worker>, post: F) -> Box<dyn Worker>
where F: FnOnce(Result<(), WorkerError>) -> Fut + Send + 'static, Fut: Future<Output = Result<(), WorkerError>> + Send,
Expand description

Helper that wraps the inner Worker’s join() completion signal in a post-processor and returns a fresh Box<dyn Worker>. All the middleware wrap paths (Audit / MainAI / Senior / LongHold / Lua after-hook, and so on) go through this helper for consistency.

The cancel token is inherited from the inner Worker verbatim, so cancelling from outside the engine still reaches the inner Worker. worker_id is also carried over from the inner Worker.