1
0
mirror of https://github.com/actix/actix-website synced 2024-11-24 00:41:07 +01:00

Merge pull request #172 from cmtm/patch-1

Fix grammar in documentation
This commit is contained in:
Yuki Okushi 2020-05-25 15:35:52 +09:00 committed by GitHub
commit 55735a3609
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -13,26 +13,26 @@ must have `Send` + `Sync` boundaries. More about that in the *multi-threading* s
To bind to a specific socket address, [`bind()`][bindmethod] must be used, and it may be To bind to a specific socket address, [`bind()`][bindmethod] must be used, and it may be
called multiple times. To bind ssl socket, [`bind_openssl()`][bindopensslmethod] or called multiple times. To bind ssl socket, [`bind_openssl()`][bindopensslmethod] or
[`bind_rustls()`][bindrusttls] should be used. To run the http server, use `HttpServer::run()` [`bind_rustls()`][bindrusttls] should be used. To run the http server, use the `HttpServer::run()`
method. method.
{{< include-example example="server" section="main" >}} {{< include-example example="server" section="main" >}}
`run()` method returns instance of [`Server`][server] type. Methods of server type The `run()` method returns an instance of the [`Server`][server] type. Methods of server type
could be used for managing http server could be used for managing the http server
- `pause()` - Pause accepting incoming connections - `pause()` - Pause accepting incoming connections
- `resume()` - Resume accepting incoming connections - `resume()` - Resume accepting incoming connections
- `stop()` - Stop incoming connection processing, stop all workers and exit - `stop()` - Stop incoming connection processing, stop all workers and exit
Following example shows how to start http server in separate thread. The following example shows how to start the http server in a separate thread.
{{< include-example example="server" file="signals.rs" section="signals" >}} {{< include-example example="server" file="signals.rs" section="signals" >}}
## Multi-threading ## Multi-threading
`HttpServer` automatically starts a number of http *workers*, by default this number is `HttpServer` automatically starts a number of http *workers*, by default this number is
equal to number of logical CPUs in the system. This number can be overridden with the equal to the number of logical CPUs in the system. This number can be overridden with the
[`HttpServer::workers()`][workers] method. [`HttpServer::workers()`][workers] method.
{{< include-example example="server" file="workers.rs" section="workers" >}} {{< include-example example="server" file="workers.rs" section="workers" >}}
@ -137,7 +137,7 @@ can change this parameter with the [`HttpServer::shutdown_timeout()`][shutdownti
method. method.
You can send a stop message to the server with the server address and specify if you want You can send a stop message to the server with the server address and specify if you want
graceful shutdown or not. The [`start()`][startmethod] method returns address of the server. graceful shutdown or not. The [`start()`][startmethod] method returns the address of the server.
`HttpServer` handles several OS signals. *CTRL-C* is available on all OSs, other signals `HttpServer` handles several OS signals. *CTRL-C* is available on all OSs, other signals
are available on unix systems. are available on unix systems.