Skip to content

Commit

Permalink
fix description of send_to_broadcast_ws handler
Browse files Browse the repository at this point in the history
  • Loading branch information
robjtede committed Aug 30, 2023
1 parent 8de8672 commit a998ce8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions websockets/echo-actorless/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ async fn echo_ws(req: HttpRequest, stream: web::Payload) -> Result<HttpResponse,
Ok(res)
}

/// Handshake and start broadcast WebSocket handler with heartbeats.
async fn send(
/// Send message to clients connected to broadcast WebSocket.
async fn send_to_broadcast_ws(
body: web::Bytes,
tx: web::Data<broadcast::Sender<web::Bytes>>,
) -> Result<impl Responder, Error> {
Expand Down Expand Up @@ -81,7 +81,7 @@ async fn main() -> std::io::Result<()> {
.service(web::resource("/ws-basic").route(web::get().to(echo_ws)))
.app_data(web::Data::new(tx.clone()))
.service(web::resource("/ws-broadcast").route(web::get().to(broadcast_ws)))
.service(web::resource("/send").route(web::post().to(send)))
.service(web::resource("/send").route(web::post().to(send_to_broadcast_ws)))
// enable logger
.wrap(middleware::Logger::default())
})
Expand Down

0 comments on commit a998ce8

Please sign in to comment.