diff --git a/guide/src/qs_4.md b/guide/src/qs_4.md index b96d64bf..e44483d0 100644 --- a/guide/src/qs_4.md +++ b/guide/src/qs_4.md @@ -1,7 +1,7 @@ # Handler -A request handler can by any object that implements -[`Handler` trait](../actix_web/dev/trait.Handler.html#implementors). +A request handler can by any object that implements +[*Handler trait*](../actix_web/dev/trait.Handler.html). Request handling happen in two stages. First handler object get called. Handle can return any object that implements [*Responder trait*](../actix_web/trait.Responder.html#foreign-impls). @@ -11,7 +11,7 @@ result of the `respond_to()` call get converted to `Reply` object. By default actix provides `Responder` implementations for some standard types, like `&'static str`, `String`, etc. For complete list of implementations check -[Responder documentation](../actix_web/trait.Responder.html#foreign-impls). +[*Responder documentation*](../actix_web/trait.Responder.html#foreign-impls). Examples of valid handlers: @@ -115,6 +115,11 @@ fn main() { } ``` +Be careful with synchronization primitives like *Mutex* or *RwLock*. Actix web framework +handles request asynchronously, by blocking thread execution all concurrent +request handling processes would block. If you need to share or update some state +from multiple threads consider using [actix](https://actix.github.io/actix/actix/) actor system. + ## Response with custom type To return custom type directly from handler function type needs to implement `Responder` trait. diff --git a/guide/src/qs_7.md b/guide/src/qs_7.md index a51c5c8a..f4fdf5e9 100644 --- a/guide/src/qs_7.md +++ b/guide/src/qs_7.md @@ -6,8 +6,9 @@ Builder-like patter is used to construct an instance of `HttpResponse`. `HttpResponse` provides several method that returns `HttpResponseBuilder` instance, which is implements various convinience methods that helps build response. Check [documentation](../actix_web/dev/struct.HttpResponseBuilder.html) -for type description. Methods `.body`, `.finish`, `.json` finalizes response creation, -if this methods get call for the same builder instance, builder will panic. +for type description. Methods `.body`, `.finish`, `.json` finalizes response creation and +returns constructed *HttpResponse* instance. if this methods get called for the same +builder instance multiple times, builder will panic. ```rust # extern crate actix_web;