mirror of
https://github.com/actix/actix-web.git
synced 2024-11-03 15:39:50 +00:00
Guide: tweak to database integration.
This commit is contained in:
parent
3a80cb7bf3
commit
94b41fd484
1 changed files with 3 additions and 3 deletions
|
@ -34,7 +34,7 @@ impl Message for CreateUser {
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
We can send a `CreateUser` message to the `DbExecutor` actor, and as a result, we receive a
|
We can send a `CreateUser` message to the `DbExecutor` actor, and as a result, we will receive a
|
||||||
`User` model instance. Next, we must define the handler implementation for this message.
|
`User` model instance. Next, we must define the handler implementation for this message.
|
||||||
|
|
||||||
```rust,ignore
|
```rust,ignore
|
||||||
|
@ -98,8 +98,8 @@ fn main() {
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
Finally, we use the address in a request handler. We receive the message response
|
We will use the address in a request handler. The handle returns a future object;
|
||||||
asynchronously, thus the handler returns a future object.
|
thus, we receive the message response asynchronously.
|
||||||
`Route::a()` must be used for async handler registration.
|
`Route::a()` must be used for async handler registration.
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue