1
0
Fork 0
mirror of https://github.com/actix/actix-web.git synced 2024-11-26 19:41:12 +00:00

various typos

This commit is contained in:
Nikolay Kim 2017-12-26 21:07:51 -08:00
parent 183bcd38f8
commit 0d21c2da22
3 changed files with 6 additions and 6 deletions

View file

@ -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. `User` model. Now we need to define actual handler implementation for this message.
```rust,ignore ```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. can access it.
```rust,ignore ```rust,ignore
/// This is state where we store *DbExecutor* address. /// This is state where we will store *DbExecutor* address.
struct State { struct State {
db: SyncAddress<DbExecutor>, db: SyncAddress<DbExecutor>,
} }
@ -77,7 +77,7 @@ struct State {
fn main() { fn main() {
let sys = actix::System::new("diesel-example"); let sys = actix::System::new("diesel-example");
// Start 3 db executors // Start 3 parallele db executors
let addr = SyncArbiter::start(3, || { let addr = SyncArbiter::start(3, || {
DbExecutor(SqliteConnection::establish("test.db").unwrap()) 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 asynchronously, so handler needs to return future object, also `Route::a()` needs to be
used for async handler registration. used for async handler registration.

View file

@ -122,7 +122,7 @@ from multiple threads consider using [actix](https://actix.github.io/actix/actix
## Response with custom type ## 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: Let's create response for custom type that serializes to `application/json` response:
```rust ```rust

View file

@ -3,7 +3,7 @@
Actix supports WebSockets out-of-the-box. It is possible to convert request's `Payload` 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 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 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. with http actor.
```rust ```rust