-
Notifications
You must be signed in to change notification settings - Fork 22
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
Coroutines section #42
Conversation
serras
commented
Feb 27, 2023
•
edited
Loading
edited
- High-level concurrency
- Flows
- Resources (in progress)
- STM (copied and edited from the current docs)
- Concurrency primitives (stub)
I think it's easier if we work on the whole section in a single PR. The Resources section is now half-edited, copied from the current docs. My aim is to heavily edit it, so take it with a grain of salt right now. @nomisRev could you take care of the section about |
Yes, I can take care of that |
Yes, I think that would be the most productive way of working. |
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.
Great docs so far @serras 🙌 Awesome work 😍
Some comments or questions, and I think we should add KotlinX Knit, and assertions.
@serras found quite some broken code after adding KotlinX Knit, we should really keep up with adding KotlinX Knit everywhere or I'm afraid we'll end up with a lot of broken/incorrect snippets over time. Not sure if you skipped it because it's still [DRAFT], but from experience I found it easier to do right away than to catch up with it afterwards. |
I wasn't really aware of Knit here. I certainly agree with you, it's easier to do it on the go than afterwards. I'll keep it on my work cycle from now on. |
Co-authored-by: Simon Vergauwen <[email protected]>
The actual magic is that `Resource` is nothing more than a type alias for | ||
parameter-less function using `ResourceScope`, | ||
|
||
```kotlin | ||
typealias Resource<A> = suspend ResourceScope.() -> A | ||
``` | ||
|
||
::: |
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.
❤️ We need to include such an :::info block for Effect
as well explaining it's just an typealias
for a receiver lambda.
content/learn/coroutines/parallel.md
Outdated
return the same type, and we don't care which one "wins", we conflate both into | ||
a single value. | ||
|
||
## Integration with typed errors |
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'm not quite happy with the examples I used here.. I hope to figure out something better while working on the KotlinConf workshop.
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'm merging, but I'm opening an issue so that we don't forget about this.
I've agreed with @nomisRev to first create a stub for concurrency primitives, which we could later expand. So this section is ready for review. |