Skip to content

Commit

Permalink
Write proper shutdown await code
Browse files Browse the repository at this point in the history
  • Loading branch information
temeddix committed Sep 29, 2024
1 parent a4fc405 commit 577f4b9
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions documentation/docs/frequently-asked-questions.md
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,7 @@ pub async fn respond() {
#[tokio::main]
async fn main() {
tokio::spawn(sample_functions::respond());
rinf::dart_shutdown().await;
}
```

Expand Down
2 changes: 1 addition & 1 deletion documentation/docs/state-management.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,11 @@ impl Calculator {
async fn main() {
let mut addr = Calculator::start();
let res = addr.send(Sum(10, 5)).await;

match res {
Ok(result) => println!("SUM: {}", result),
_ => println!("Communication to the actor has failed"),
}
rinf::dart_shutdown().await;
}
```

Expand Down
3 changes: 3 additions & 0 deletions documentation/docs/tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ mod tutorial_functions;
#[tokio::main]
async fn main() {
tokio::spawn(tutorial_functions::calculate_precious_data());
rinf::dart_shutdown().await;
}
```

Expand Down Expand Up @@ -142,6 +143,7 @@ mod tutorial_functions;
#[tokio::main]
async fn main() {
tokio::spawn(tutorial_functions::stream_amazing_number());
rinf::dart_shutdown().await;
}
```

Expand Down Expand Up @@ -231,5 +233,6 @@ mod tutorial_functions;
#[tokio::main]
async fn main() {
tokio::spawn(tutorial_functions::tell_treasure());
rinf::dart_shutdown().await;
}
```

0 comments on commit 577f4b9

Please sign in to comment.