-
Couldn't load subscription status.
- Fork 1.4k
Review: Remove as many .map and .flatMap calls as possible
#9387
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
Merged
guizmaii
merged 8 commits into
simplify_ZChannel_mergeAllWith
from
simplify_ZChannel_mergeAllWith_0
Dec 11, 2024
Merged
Review: Remove as many .map and .flatMap calls as possible
#9387
guizmaii
merged 8 commits into
simplify_ZChannel_mergeAllWith
from
simplify_ZChannel_mergeAllWith_0
Dec 11, 2024
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
85e41c5 to
5f71731
Compare
guizmaii
commented
Dec 10, 2024
9b007ea to
e8e9565
Compare
guizmaii
commented
Dec 11, 2024
| val outgoing = | ||
| Queue.unsafe.bounded[ZIO[Env, Either[OutErr, OutDone], OutElem]](bufferSize0, fiberId)(Unsafe.unsafe) | ||
| val cancelers = Queue.unsafe.unbounded[Promise[Nothing, Unit]](fiberId)(Unsafe.unsafe) | ||
| val lastDone = Ref.unsafe.make[OutDone](null.asInstanceOf[OutDone])(Unsafe.unsafe) |
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.
Hopefully, it's safe to null.asInstanceOf[OutDone] 🤔
Edit: Well, tests pass :)
e8e9565 to
5085cb2
Compare
.map calls as possible.map and .flatMap calls as possible
guizmaii
added a commit
that referenced
this pull request
Dec 31, 2024
* Review: Remove as many `.map` calls as possible * Update streams/shared/src/main/scala/zio/stream/ZChannel.scala * Remove Option in `lastDone` `Ref` * `SingleProducerAsyncInput.unsafe.make` * `fiberIdWith` * success first * fmt * Clean
guizmaii
added a commit
that referenced
this pull request
Jan 7, 2025
* Review: Remove as many `.map` calls as possible * Update streams/shared/src/main/scala/zio/stream/ZChannel.scala * Remove Option in `lastDone` `Ref` * `SingleProducerAsyncInput.unsafe.make` * `fiberIdWith` * success first * fmt * Clean
guizmaii
added a commit
that referenced
this pull request
Jan 11, 2025
* Review: Remove as many `.map` calls as possible * Update streams/shared/src/main/scala/zio/stream/ZChannel.scala * Remove Option in `lastDone` `Ref` * `SingleProducerAsyncInput.unsafe.make` * `fiberIdWith` * success first * fmt * Clean
kyri-petrou
added a commit
that referenced
this pull request
Jan 18, 2025
* Simplify `zio.stream.ZChannel.mergeAllWith` code * Review: Prefer `*>` * Review: Remove as many `.map` and `.flatMap` calls as possible (#9387) * Review: Remove as many `.map` calls as possible * Update streams/shared/src/main/scala/zio/stream/ZChannel.scala * Remove Option in `lastDone` `Ref` * `SingleProducerAsyncInput.unsafe.make` * `fiberIdWith` * success first * fmt * Clean * Regis review: Prefer `Exit` over `ZIO` * Regis review: Prefer `Result` over `Exit` (#9445) * Review: Remove `Result` methods * Review: Remove `ZIO.suspendSucceed` * Review: Prefer `AtomicReference` * Review: Prefer `Unsafe` * Review: Improve `zio.stream.internal.SingleProducerAsyncInput.unsafe.make` * Fix tests * Rollback `AtomicReference` change * uninterruptible finalizers * Fix imports * clean code * Fix wrong `.map` usage * Put back `AtomicReference` --------- Co-authored-by: kyri-petrou <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.