1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
//! Runtime integration macros.
//!
//! This crate intentionally has no async-runtime dependency. The macros below
//! expand to calls into the runtime selected by the application, so users must
//! depend on that runtime themselves.
/// Generates an ID from the singleton in a Tokio async context, yielding while
/// the singleton generator is blocked.
///
/// The macro retries on [`crate::BeakIdError::Blocked`] and calls
/// `tokio::task::yield_now().await` between attempts, allowing the background
/// updater task to advance real time.
///
/// # Examples
///
/// ```ignore
/// let id = beakid::tokio_next_id!();
/// ```
/// Generates an ID from the singleton in a smol async context, yielding while
/// the singleton generator is blocked.
///
/// The macro retries on [`crate::BeakIdError::Blocked`] and calls
/// `smol::future::yield_now().await` between attempts, allowing the background
/// updater task to advance real time.
///
/// # Examples
///
/// ```ignore
/// let id = beakid::smol_next_id!();
/// ```