use crate::error::PoolError;
use std::collections::HashSet;
use std::future::Future;
use std::pin::Pin;
use fibre::oneshot;
use tokio_util::sync::CancellationToken;
pub type TaskLabel = String;
pub type TaskToExecute<R> = Pin<Box<dyn Future<Output = R> + Send + 'static>>;
pub(crate) struct ManagedTaskInternal<R: Send + 'static> {
pub(crate) task_id: u64,
pub(crate) labels: HashSet<TaskLabel>,
pub(crate) future: TaskToExecute<R>,
pub(crate) token: CancellationToken,
pub(crate) result_sender: Option<oneshot::Sender<Result<R, PoolError>>>,
}