mirror of
https://github.com/actix/actix-web.git
synced 2024-12-23 16:40:37 +00:00
various typos
This commit is contained in:
parent
183bcd38f8
commit
0d21c2da22
3 changed files with 6 additions and 6 deletions
|
@ -31,7 +31,7 @@ struct CreateUser {
|
|||
}
|
||||
```
|
||||
|
||||
We can send `CreateUser` message to `DbExecutor` actor, and as result we can get
|
||||
We can send `CreateUser` message to `DbExecutor` actor, and as result we get
|
||||
`User` model. Now we need to define actual handler implementation for this message.
|
||||
|
||||
```rust,ignore
|
||||
|
@ -69,7 +69,7 @@ All we need is to start *DbExecutor* actors and store address in a state where h
|
|||
can access it.
|
||||
|
||||
```rust,ignore
|
||||
/// This is state where we store *DbExecutor* address.
|
||||
/// This is state where we will store *DbExecutor* address.
|
||||
struct State {
|
||||
db: SyncAddress<DbExecutor>,
|
||||
}
|
||||
|
@ -77,7 +77,7 @@ struct State {
|
|||
fn main() {
|
||||
let sys = actix::System::new("diesel-example");
|
||||
|
||||
// Start 3 db executors
|
||||
// Start 3 parallele db executors
|
||||
let addr = SyncArbiter::start(3, || {
|
||||
DbExecutor(SqliteConnection::establish("test.db").unwrap())
|
||||
});
|
||||
|
@ -94,7 +94,7 @@ fn main() {
|
|||
}
|
||||
```
|
||||
|
||||
And finally we can use this state in a requst handler. We get message response
|
||||
And finally we can use address in a requst handler. We get message response
|
||||
asynchronously, so handler needs to return future object, also `Route::a()` needs to be
|
||||
used for async handler registration.
|
||||
|
||||
|
|
|
@ -122,7 +122,7 @@ from multiple threads consider using [actix](https://actix.github.io/actix/actix
|
|||
|
||||
## Response with custom type
|
||||
|
||||
To return custom type directly from handler function type needs to implement `Responder` trait.
|
||||
To return custom type directly from handler function, type needs to implement `Responder` trait.
|
||||
Let's create response for custom type that serializes to `application/json` response:
|
||||
|
||||
```rust
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
Actix supports WebSockets out-of-the-box. It is possible to convert request's `Payload`
|
||||
to a stream of [*ws::Message*](../actix_web/ws/enum.Message.html) with
|
||||
a [*ws::WsStream*](../actix_web/ws/struct.WsStream.html) and then use stream
|
||||
combinators to handle actual messages. But it is simplier to handle websocket communication
|
||||
combinators to handle actual messages. But it is simplier to handle websocket communications
|
||||
with http actor.
|
||||
|
||||
```rust
|
||||
|
|
Loading…
Reference in a new issue