Skip to content

Are the methods implemented on Websocket cancellation-safe? #6

@cactusdualcore

Description

@cactusdualcore

Is cancellation of futures yielded by methods of this library (e.g. Websocket::receive) safe?

Imagine a scenario like this

async fn foo() {
  // ...
  tokio::select!{
    _ = done_soon() => {
      do_stuff()
    },
    _ = websocket.receive() => {
      // ...
    }
  }
}

If done_soon finishes while Websocket::receive processes an incoming Frame, will the frame be lost?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions