1
0
mirror of https://github.com/actix/actix-website synced 2025-06-29 08:14:58 +02:00

document how to start the app with state

This commit is contained in:
Yann Simon
2018-06-08 10:17:29 +02:00
parent 5938691794
commit 14e47859a0
2 changed files with 16 additions and 0 deletions

View File

@ -62,6 +62,10 @@ When the app is initialized it needs to be passed the initial state:
> must be constructed multiple times. If you want to share state between different threads, a
> shared object should be used, e.g. `Arc`. Application state does not need to be `Send` and `Sync`,
> but the application factory must be `Send` + `Sync`.
>
> To start the previous app, create it into a closure:
{{< include-example example="application" file="state.rs" section="start_app" >}}
## Combining applications with different state