mirror of https://github.com/rwf2/Rocket.git
Fix WebSocket FAQ entry, typos.
This commit is contained in:
parent
b15dc700aa
commit
fd739bab4e
|
@ -349,7 +349,7 @@ pub fn execute<R, F>(future: F) -> R
|
||||||
async_main(future)
|
async_main(future)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Returns a future that evalutes to `true` exactly when there is a presently
|
/// Returns a future that evaluates to `true` exactly when there is a presently
|
||||||
/// running tokio async runtime that was likely started by Rocket.
|
/// running tokio async runtime that was likely started by Rocket.
|
||||||
fn running_within_rocket_async_rt() -> impl std::future::Future<Output = bool> {
|
fn running_within_rocket_async_rt() -> impl std::future::Future<Output = bool> {
|
||||||
use futures::FutureExt;
|
use futures::FutureExt;
|
||||||
|
|
|
@ -162,7 +162,7 @@ impl Rocket<Orbit> {
|
||||||
};
|
};
|
||||||
|
|
||||||
if let Some((proto, io_handler)) = upgrade {
|
if let Some((proto, io_handler)) = upgrade {
|
||||||
info_!("Attemping upgrade with {proto} I/O handler.");
|
info_!("Attempting upgrade with {proto} I/O handler.");
|
||||||
response.set_status(Status::SwitchingProtocols);
|
response.set_status(Status::SwitchingProtocols);
|
||||||
response.set_raw_header("Connection", "Upgrade");
|
response.set_raw_header("Connection", "Upgrade");
|
||||||
response.set_raw_header("Upgrade", proto.to_string());
|
response.set_raw_header("Upgrade", proto.to_string());
|
||||||
|
|
|
@ -267,13 +267,6 @@ bit simpler, and you may find SSE sufficient for your use-case. For instance,
|
||||||
the [chat example] uses SSE to implement a real-time, multiroom chat
|
the [chat example] uses SSE to implement a real-time, multiroom chat
|
||||||
application.
|
application.
|
||||||
|
|
||||||
That being said, Rocket _does_ suport [Server-Sent Events], which allows for
|
|
||||||
real-time _unidirectional_ communication from the server to the client. This is
|
|
||||||
often sufficient for many of the applications that WebSockets are typically used
|
|
||||||
for. For instance, the [chat example] uses SSE to implement a real-time,
|
|
||||||
multiroom chat application.
|
|
||||||
|
|
||||||
[working on it]: https://github.com/rwf2/Rocket/issues/90
|
|
||||||
[Server-Sent Events]: @api/master/rocket/response/stream/struct.EventStream.html
|
[Server-Sent Events]: @api/master/rocket/response/stream/struct.EventStream.html
|
||||||
[chat example]: @git/master/examples/chat
|
[chat example]: @git/master/examples/chat
|
||||||
{{ endfaq() }}
|
{{ endfaq() }}
|
||||||
|
|
Loading…
Reference in New Issue