Scarlet
Scarlet copied to clipboard
How to change channels at runtime ?
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> }
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?