aboutsummaryrefslogtreecommitdiff
path: root/examples/async-task.rs
diff options
context:
space:
mode:
authorGravatar Emil Fresk <emil.fresk@gmail.com> 2023-01-10 21:03:10 +0100
committerGravatar Henrik Tjäder <henrik@tjaders.com> 2023-03-01 00:33:30 +0100
commitd6d58b0eb88242cf63724e1420bd29f8a4489916 (patch)
treed797b67b381947cc375d9c89cdc15d0cc98dee1a /examples/async-task.rs
parentcd790a94286cdc307d399b7f7a43e305e90de5bf (diff)
downloadrtic-d6d58b0eb88242cf63724e1420bd29f8a4489916.tar.gz
rtic-d6d58b0eb88242cf63724e1420bd29f8a4489916.tar.zst
rtic-d6d58b0eb88242cf63724e1420bd29f8a4489916.zip
Async tasks can now take arguments at spawn again
Diffstat (limited to 'examples/async-task.rs')
-rw-r--r--examples/async-task.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/examples/async-task.rs b/examples/async-task.rs
index 780bc081..e1ab1432 100644
--- a/examples/async-task.rs
+++ b/examples/async-task.rs
@@ -27,6 +27,7 @@ mod app {
hprintln!("init");
async_task::spawn().unwrap();
+ async_task_args::spawn(1, 2).unwrap();
async_task2::spawn().unwrap();
(Shared { a: 0 }, Local {})
@@ -53,6 +54,11 @@ mod app {
hprintln!("hello from async");
}
+ #[task]
+ async fn async_task_args(_cx: async_task_args::Context, a: u32, b: i32) {
+ hprintln!("hello from async with args a: {}, b: {}", a, b);
+ }
+
#[task(priority = 2, shared = [a])]
async fn async_task2(cx: async_task2::Context) {
let async_task2::SharedResources { a: _, .. } = cx.shared;