Skip to main content

libdd_common/
worker.rs

1// Copyright 2025-Present Datadog, Inc. https://www.datadoghq.com/
2// SPDX-License-Identifier: Apache-2.0
3
4/// Trait representing a generic worker.
5///
6/// The worker runs an async looping function running periodic tasks.
7///
8/// This trait can be used to provide wrapper around a worker.
9pub trait Worker {
10    /// Main worker loop
11    fn run(&mut self) -> impl std::future::Future<Output = ()> + Send;
12}