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.

Make Riptide async by default?

See original GitHub issue

Right now we always have to maintain two APIs: Rest (sync) and AsyncRest (async). Because of Riptide’s design they both support the very same routing trees out of the box. This already makes Riptide stand out from the competition, since their APIs usually differ dramatically between the two approaches.

The problem we have right now is the different return value for async: ListenableFuture<Capture> vs. Capture. Translating from async to sync is relative easy:

http.get(..)
        .dispatch(..)
        .to(Success.class);

vs.

http.get(..)
        .dispatch(..)
        .get(10, SECONDS)
        .to(Success.class);

Given this, should we consider dropping the dedicated support for the synchronous version altogether?

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:2
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
whiskeysierracommented, Jun 8, 2016

In addition if we use Hystrix (which we really should) we already have a threadpool anyways, so that’s not a big downside.

0reactions
whiskeysierracommented, Jun 8, 2016

but blocking calls are probably still the main usecase

They are right now, but that’s probably just caused by our mindset. If my tools would allow me to perform some request asynchronously, I’d probably do it way more often.

Read more comments on GitHub >

github_iconTop Results From Across the Web

riptide/README.md at main · zalando/riptide - GitHub
Non-blocking IO is asynchronous by nature. In order to provide asynchrony for blocking IO you need to register an executor. Not passing an...
Read more >
Async by default with 'use async'; - APIs - WICG
Let the developer specify it wants its code to be async by default, by adding a 'use async'; instruction to the EcmaScript specification....
Read more >
Why shouldn't all functions be async by default? - Stack Overflow
The primary reason to not make everything async is because the purpose of async/await is to make it easier to write code in...
Read more >
Making flows asynchronous by default - Node-RED
In Node-RED 1.0, we are changing the way messages pass between nodes from being synchronous to being asynchronous. This will, in some cases, ......
Read more >
trdelnik-sandbox-cli - crates.io: Rust Package Registry
Trdelnik client - build and deploy an Anchor program to a local cluster and ... #[throws] #[fixture] async fn init_fixture() -> Fixture {...
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