Skip to content

WS: Make web socket DI friendly #3914

@kliushnichenko

Description

@kliushnichenko

It would be nice to have a websocket handler DI-friendly in the same way controllers are, for avaje-inject in particular.

The following example won't work due to avaje module lateinit nature:

{
    install(AvajeInjectModule.of(
                BeanScope.builder()
                        .bean(WebsocketHandler.class, new WebsocketHandler()))
    );
    ws("/ws", require(WebsocketHandler.class));
}

The only way I managed to make it is by moving ws() into a separate lateinit extension that should be initialized after Avaje

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions