Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@adamgfraser
Copy link
Contributor

Implements a specialized version of the register function in ZStream.effectAsync. This is compatible with all existing code since Register is just a more specific version of the previous register function.

This lets us implement some additional convenience methods on Register for emitting a single value or a chunk of values, failing, ending, and so on.

It does add an additional layer of indirection to the type signature of effectAsync, but the existing one is already relatively complicated so not sure this is a step back.

Copying @kitlangton.

@adamgfraser adamgfraser requested a review from iravid as a code owner August 14, 2021 23:41
@kitlangton
Copy link
Member

Nice! Thanks, @adamgfraser! I think a benefit of this, besides clarifying the somewhat confusing signature ((ZIO[R, Option[E], Chunk[A]] => Future[Boolean]) => Unit), is that it allows us to document and suggest, via autocomplete, its intended usage.

@adamgfraser adamgfraser requested a review from jdegoes August 15, 2021 02:47
Copy link
Member

@iravid iravid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Love it 👌

@adamgfraser adamgfraser merged commit 61dcde3 into zio:master Aug 15, 2021
@adamgfraser adamgfraser deleted the register branch August 15, 2021 13:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants