-
Notifications
You must be signed in to change notification settings - Fork 21
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
Arrow 2.0 release notes #312
Conversation
content/blog/2024-07-01-arrow-2-0.md
Outdated
The new `awaitAll` scope tries to improve the situation by tweaking the | ||
usual `async` mechanism, ensuring that all `Deferred` values are `await`ed | ||
once the first one is requested. That means that the previous code behaves | ||
identically to the following. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added new documentation in a DRAFT PR that explains the actual issue. This is an example:
coroutineScope {
val x = async { awaitCancellation() }
val y = async { throw CancellationException("Boom!") }
...
}
This hangs forever, which means this also hangs forever:
either {
coroutineScope {
val x = async { awaitCancellation() }
val y = async { raise("Boom!") }
...
}
}
And awaitAll
solves that issue by actually awaiting all parallel jobs in parallel. More elaborate here, https://github.com/arrow-kt/arrow/pull/3443/files#diff-eba615458a6921b379f1477f70993424b278b3de927ece7e998c5bf7dba6f7f0R38
```kotlin | ||
Schedule.recurs<Throwable>(2) | ||
.retry<IllegalArgumentException, _> { ... } | ||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See other comment, I think it is important we can call doWhile
on IllegalArgumentException
here as well.
Closed as part of #333 |
It's never too early to start with this.