Skip to content

Research websocket support #42

@avkonst

Description

@avkonst

Allow to add a handler to the builder which returns a stream of reflectapi::Output capable type.
And bind this stream to the websocket notifications at the into_axum_router converter.
Generated clients, especially typescript, should allow to bind strongly typed notifications handler.

from prior discussion:
the handler which would return Result<Stream<T: reflectapi::Output>> and on the TS codegen (first priority) to deliver the messages in the strong type fashion if onmessage bounded callback handler?
https://developer.mozilla.org/en-US/docs/Web/API/WebSockets_API/Writing_WebSocket_client_applications
https://github.com/tokio-rs/axum/blob/main/examples/websockets/src/main.rs
note: the handler does not need to receive user messages post connections setup, but needs to send notification of user's type T and responde to ping/close .. etc.. events correctly - I assume this goes to the converter from reflectapi router to axum router.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions