Skip to content

Auto-discovery of websocket implementation dependencies #252

@joffrey-bion

Description

@joffrey-bion

We could provide a StompClient() factory function without WebSocketClient argument, which would discover an implementation automatically the same way ServiceLoader does on the JVM.

Ktor's HttpClient() factory function uses a ServiceLoader on JVM, and some interesting eager-initialization shenanigans to register implementations in a list and get a similar effect on Kotlin/Native. On JS, they only have one implementation. Maybe we could pull off something similar on JS too nonetheless (however, see issue KT-51626 and its workaround)

For reference, here is my issue on the Kotlin YouTrack for adding a multiplatform equivalent to the JVM's ServiceLoader:
https://youtrack.jetbrains.com/issue/KT-53056/Multiplatform-equivalent-of-JVMs-ServiceLoader

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions