Scarlet icon indicating copy to clipboard operation
Scarlet copied to clipboard

How to change channels at runtime ?

Open leandro120 opened this issue 6 years ago • 1 comments

I have multiple channels to listen, is there any way to change at runtime?

single {
    Scarlet.Builder()
        .webSocketFactory(get<OkHttpClient>().newWebSocketFactory("https://stream.push.qa.globoi.com/ws/"))
        .addMessageAdapterFactory(MoshiMessageAdapter.Factory())
        .addStreamAdapterFactory(RxJava2StreamAdapterFactory())
        .build()
}

now i have this:

interface LiveStreamService {
    @Receive
    fun liveStream(): Flowable<StreamDTO>
}

there is something similar?

interface LiveStreamService {
    @Receive
    @GET("{path}")
    fun liveStream(@Path("url") url: String): Flowable<StreamDTO>
}

leandro120 avatar Aug 09 '19 14:08 leandro120

Remember the interface is just the contract you can technically give it your own implementation if you like to dive into the ins and out of the generated implementation by Scarlet, but what is what you are trying to achieve?

joelromanpr avatar Sep 04 '19 01:09 joelromanpr