We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Creating a second Service like this makes the socket reconnect, thereby opening multiple connections
@Provides @Singleton fun provideAuthService(scarlet: Scarlet): Service1 { return scarlet.create(Service1::class.java) } @Provides @Singleton fun providesUserService(scarlet: Scarlet): Service2 { return scarlet.create(Service2::class.java) } @Provides @Singleton fun providesScarlet(): Scarlet { val client = OkHttpClient.Builder() .connectTimeout(60, TimeUnit.SECONDS) .readTimeout(60, TimeUnit.SECONDS) .writeTimeout(60, TimeUnit.SECONDS) return Scarlet.Builder() .webSocketFactory(client.build().newWebSocketFactory(baseUrl)) .addMessageAdapterFactory( WebSocketMessageAdapter.Factory() ) .addStreamAdapterFactory(FlowStreamAdapter.Factory) //.lifecycle(AndroidLifecycle.ofApplicationForeground(application)) .backoffStrategy(BACKOFF_STRATEGY) //remove .build() }
Is this an intended behavior? because having just one service with a long list of @Send and @Receive doesn't look neat.
@Send
@Receive
The text was updated successfully, but these errors were encountered:
Сould you find a solution?
Sorry, something went wrong.
No branches or pull requests
Creating a second Service like this makes the socket reconnect, thereby opening multiple connections
Is this an intended behavior? because having just one service with a long list of
@Send
and@Receive
doesn't look neat.The text was updated successfully, but these errors were encountered: