ignite-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Yakov Zhdanov <yzhda...@apache.org>
Subject Re: .Net: separate methods for async operations.
Date Mon, 12 Oct 2015 10:43:20 GMT
> 2 lines of code instead of one is not a big deal in my view.

>It is 2 times too much, sometimes even more. Imagine a situation where you
>need to perform multiple async operations:

>cache.Get(1);
>var res = await cache.GetFuture<int>().ToTask();

>compute.Call(new MyCallable(res))
>var res2 = await compute.GetFuture<string>().ToTask()


>And with proper async API it can even be a one-liner.
>var res2 = await compute.CallAsync(new MyCallable(await
cache.GetAsync(1)));

It seems that this example does not show the proper usecase for async APIs.
If it is reimplemented in sync manner it would become clearer and,
probably, faster. What is the purpose of async here if I wait in current
thread?

--Yakov

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message