Skip to content
New issue

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

Support kotlin coroutines #383

Open
IvanPavlov1995 opened this issue May 20, 2021 · 3 comments · May be fixed by #486
Open

Support kotlin coroutines #383

IvanPavlov1995 opened this issue May 20, 2021 · 3 comments · May be fixed by #486

Comments

@IvanPavlov1995
Copy link

I don't see any mentioning of kotlin coroutines adapter or something like that, does it exist? If it doesn't, it would be really great to have such integration

@kptfh
Copy link
Collaborator

kptfh commented May 24, 2021

Unfortunately I'm not familiar with Kotlin.
Can you make some draft hot it should look like?
Are there any adapters for blocking feign client (aka OpenFeign)?

@IvanPavlov1995
Copy link
Author

I haven't seen such thing for blocking feign. Probably, that's because asynchronous nature of coroutines.
I know that there is retrofit library implementation of something similar, here are some links about it
https://github.com/square/retrofit/blob/master/CHANGELOG.md#version-260-2019-06-05
https://github.com/square/retrofit/blob/master/retrofit/src/main/java/retrofit2/HttpServiceMethod.java

It might be useful to look at kotlin coroutines library which provides an adapter to reactor: https://github.com/Kotlin/kotlinx.coroutines/tree/master/reactive/kotlinx-coroutines-reactor

Also spring-webflux support coroutines natively, so it might be useful to look there too.

If I understand everything correctly,

Mono<T> request1();

Flux<E> request2();

should become

suspend request1(): T

request2(): Flow<E>

@hamza-maqsood
Copy link

add suspend support please, or is there an alternate?

wplong11 added a commit to wplong11/feign-reactive that referenced this issue Jul 31, 2022
Resolves: PlaytikaOSS#383

Inspired by https://github.com/stas29a/coroutine-feign-client

## TODO

- [ ] Separate Kotlin support module
- [ ] Enhance test case
@wplong11 wplong11 linked a pull request Jul 31, 2022 that will close this issue
4 tasks
wplong11 added a commit to wplong11/feign-reactive that referenced this issue Jul 31, 2022
Resolves: PlaytikaOSS#383

Inspired by https://github.com/stas29a/coroutine-feign-client

## TODO

- [ ] Separate Kotlin support module
- [ ] Enhance test case
- [ ] Refactoring
- [ ] Clean up pom.xml
wplong11 added a commit to wplong11/feign-reactive that referenced this issue Aug 2, 2022
Resolves: PlaytikaOSS#383

Inspired by https://github.com/stas29a/coroutine-feign-client

## TODO

- [ ] Separate Kotlin support module
- [ ] Enhance test case
- [ ] Refactoring
- [ ] Clean up pom.xml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants