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
use *;
use Runtime;
/// Plugin that initializes the Tokio runtime
///
/// This plugin is automatically added when you use the `BevyDojoPlugin`.
/// It creates a multi-threaded Tokio runtime for executing async tasks.
;
/// Resource that holds the Tokio runtime
///
/// This resource provides access to the Tokio runtime for executing async tasks.
/// It is automatically added when you use the `TokioPlugin` or `BevyDojoPlugin`.
///
/// # Example
///
/// ```no_run
/// fn my_system(runtime: Res<TokioRuntime>) {
/// // Spawn an async task
/// runtime.runtime.spawn(async {
/// // Do something async
/// });
/// }
/// ```