#[cfg(feature = "node")]
use std::future::Future;
#[cfg(feature = "node")]
use std::time::Duration;
#[cfg(feature = "node")]
pub(crate) use rings_test_support::activity::record_activity;
pub(crate) use rings_test_support::observer::activity_observer;
#[cfg(feature = "node")]
pub(crate) async fn probe_on_activity<T, F>(
label: &str,
hang_guard: Duration,
probe: impl FnMut() -> F,
) -> crate::error::Result<T>
where
F: Future<Output = crate::error::Result<Option<T>>>,
{
rings_test_support::activity::probe_on_activity(label, hang_guard, probe).await
}
#[cfg(all(rings_native, not(feature = "dummy")))]
pub(crate) struct AdmissionActivity;
#[cfg(all(rings_native, not(feature = "dummy")))]
impl crate::extension::BackendObserver for AdmissionActivity {
fn link_fact(&self, _fact: crate::extension::ext::LinkFact) {
record_activity();
}
}