<@U0CG5M9T4> it is going to released in the next v...
# coroutines
e
@rogeralsing it is going to released in the next version of
kotlinx.coroutines
under the name of
CompletableDeferred
(unless we find something better) and is now available in
develop
branch.
🍻 3
r
elizarov: is there also some way to create a deferred from a result? .NET has Task.FromResult(...) making all code that awaits on such Task take the fast synchronous path
g
I think I asked a similar question a while ago and I got a kind of interesting answer: coroutines deliberately dont have a "fast synchronous path", the idea basicallyb eing that if you API has aynchronous behaviour then it should either always run asynchronously or always run synchronously.
r
but what does that even mean? e.g. if suspend func Foo() calls suspend func Bar().. bar is just returning a value. e.g. 123... what does "run arcynchronously" mean in that context? will there be a yield upon calling Bar from Foo?
in .NET, that would have been a synchronous flow where the 123 is wrapped in a completed Task
g
yeah I should say rogeralsing I've spent a fair bit of time with WPF so im pretty familiar with .net tasks --albeit when I was doing that C# 4 was new
ill see if i can dig up the article I was linked to and send it to you