Registry / http-client / retrofit2-kotlin-coroutines-adapter

retrofit2-kotlin-coroutines-adapter

JSON →
library0.9.2javamavenunverified

A CallAdapter.Factory for Kotlin coroutine's Deferred, enabling Retrofit to return Deferred from service methods.

<dependency> <groupId>com.jakewharton.retrofit</groupId> <artifactId>retrofit2-kotlin-coroutines-adapter</artifactId> <version>0.9.2</version> </dependency>
INSTALL
IMPORT
SIG · RETROFIT2-KOTLIN-C
R
retrofit2-kotlin-coroutines-adapter
http-clientjavav0.9.2
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

CoroutineCallAdapterFactory
com.jakewharton.retrofit2.adapter.kotlin.coroutines.CoroutineCallAdapterFactory

Minimal example adding CoroutineCallAdapterFactory to a Retrofit instance.

import com.jakewharton.retrofit2.adapter.kotlin.coroutines.CoroutineCallAdapterFactory; import retrofit2.Retrofit; import retrofit2.converter.gson.GsonConverterFactory; public class Quickstart { public static void main(String[] args) { Retrofit retrofit = new Retrofit.Builder() .baseUrl("https://api.example.com/") .addCallAdapterFactory(CoroutineCallAdapterFactory.create()) .addConverterFactory(GsonConverterFactory.create()) .build(); // Use retrofit to create API service } }
Debug
Known issues
breakingThis adapter is deprecated in favor of Retrofit's built-in coroutine support (suspend functions).
fix
Use Retrofit's suspend functions directly instead of Deferred adapter.
affects: <=0.9.2
Upgrade
Version history
0.9.2latest on Maven
Audit
Dependencies

No dependency data recorded yet.

Agent activity
13 hits · last 30 days
node
12
Amazon
1
Resources
retrofit2-kotlin-coroutines-adapter — mvn dependency:get retrofit2-kotlin-coroutines-adapter · libregistry