question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

“retrofeign” retrofits … retrofit’s async layer onto feign

This project has a lot of users, and needs some help I think. What if we tried to leverage code that has a nice design to extend the life a bit.

My theory is that we could make “retrofeign” which would allow the same contract parsing that feign existing users have, but be able to employ retrofit async layering (ex rxjava)

Ex. it would look like…

Feign feign = RetroFeign.builder()
     ... // normal things
    .callAdapterFactory(RxJava2CallAdapterFactory.create())
    .target(MyService.class, "https://example.com");
interface MyService {
  @RequestLine("GET /user")
  Observable<User> getUser();
}

The call adapter factory won’t always be portable as it relies on Retrofit. However the code there is relatively straightforward, and some of the call adapters don’t actually use the retrofit instance at all. At any case I think we could reuse the Call adapters with less effort than starting something from scratch.

https://github.com/square/retrofit/blob/master/retrofit/src/main/java/retrofit2/CallAdapter.java

It might not work, but seems like a good way to provide sustainable options to people. For example, when using okhttp client we could use this to reasonably easily create guava rxjava or other types of async things.

thoughts?

cc @jakewharton @swankjesse

Issue Analytics

  • State:open
  • Created 6 years ago
  • Reactions:5
  • Comments:16 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
kdavisk6commented, Jul 27, 2018

@velo and @kptfh, I see that you have a number of classes that are part of feign-core copied and replicated in feign-reactive-core. I think we should refactor those out so that feign-reactive-core can stay in sync with feign-core. I’m going to take a stab at this and I’ll create a PR for you all to review.

In addition, we do still have some housekeeping to do on the project, we need to enable travis and configure it to deploy once we have a release ready.

1reaction
velocommented, Jul 26, 2018

I look at the PR, I was thinking… may be, the default implementation should be only dealing with Future and then we could have reactive implementation for reactor, Callbacks and other possible implementations… how does that feel?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Final Regulations - Individuals with Disabilities Education Act
Agencies write Federal regulations to implement and enforce the statutes passed by Congress. View current IDEA regulations. Periodically, the department issues ...
Read more >
IdeaBoardz - Brainstorm, Retrospect, Collaborate
Conduct collaborative brainstorming sessions with distributed teams.
Read more >
IDEA—the Individuals with Disabilities Education Act
IDEA was originally enacted by Congress in 1975 to ensure that children with disabilities have the opportunity to receive a free appropriate public...
Read more >
IDEA LED Signs & Marketing - Facebook
IDEA LED Signs & Marketing, Kalamazoo, Michigan. 333 likes · 1 talking about this. IDEA LED SIGNS.COM LLC is an outdoor electric sign...
Read more >
Idea Journey - NetHope
And a NetHope IDEA Journey is where dreaming begins... When your organization embarks on an IDEA Journey you will design an innovative solution...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found