Created
May 1, 2020 11:25
-
-
Save ekoo/44ddc9ab013a4e306d0af39808e9972e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private val client = OkHttpClient.Builder() | |
.addInterceptor(HttpLoggingInterceptor() | |
.setLevel(HttpLoggingInterceptor.Level.BASIC)) | |
.build() | |
private fun scarletLifecycle() = AndroidLifecycle.ofApplicationForeground(getApplication()) | |
private val service = Scarlet.Builder() | |
.webSocketFactory(client.newWebSocketFactory(BASE_URL)) | |
.addStreamAdapterFactory(RxJava2StreamAdapterFactory()) | |
.addMessageAdapterFactory(GsonMessageAdapter.Factory()) | |
.lifecycle(scarletLifecycle()) | |
.build() | |
.create(BitcoinService::class.java) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment