Skip to content

Inconsistent async usage in web socket connection #668

@Kaliumhexacyanoferrat

Description

@Kaliumhexacyanoferrat

When using the OnOpen() delegate with a Websocket, the IWebsocketConnection passed by the framework indicates synchronous methods when they are actually not. The methods should be renamed to *Async and the delegate should return a ValueTask instead. We can add synchronous methods as well.

Example

Websocket.Create()
         .OnOpen(async (c) => await c.SendAsync("42"));

Additional Information

  • Either keep the changes non-breaking (e.g. with warnings) or postpone them to version 10 (and include them in a change log)

Metadata

Metadata

Assignees

No one assigned

    Labels

    breakingImplementing this will cause a breaking change so it can only be part of major releases.bugSomething isn't working

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions