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

Skip to content

Conversation

@luis3m
Copy link
Contributor

@luis3m luis3m commented May 13, 2020

@luis3m luis3m requested a review from iravid as a code owner May 13, 2020 16:03
@luis3m luis3m force-pushed the stream-debounce branch 2 times, most recently from 4e80237 to 5fc5d7d Compare May 13, 2020 16:50
@luis3m
Copy link
Contributor Author

luis3m commented May 13, 2020

Rabased on top of #3424. These two failures seem to be unrelated.

@luis3m luis3m mentioned this pull request May 13, 2020
@iravid iravid added the stream ZIO Stream label May 14, 2020
@luis3m luis3m force-pushed the stream-debounce branch from 5fc5d7d to dfb271e Compare May 16, 2020 21:42
@luis3m luis3m force-pushed the stream-debounce branch from dfb271e to 22a91c4 Compare May 16, 2020 21:52
@luis3m
Copy link
Contributor Author

luis3m commented May 17, 2020

  1. Refactored a bit
  2. Some extra annotations to fix Dotty compilation issues

@luis3m
Copy link
Contributor Author

luis3m commented May 17, 2020

I can remove the top level type parameters (required to compile dotty) by deferring them to State but I'm not sure it's worth doing

sealed abstract class State[+E, +O]
case object NotStarted                                      extends State[Nothing, Nothing]
case class Previous[O](fiber: Fiber[Nothing, Chunk[O]])     extends State[Nothing, O]
case class Current[E, O](fiber: Fiber[Option[E], Chunk[O]]) extends State[E, O]
case object Done                                            extends State[Nothing, Nothing]

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 the implementation. Awesome work @luis3m.

@reibitto I assume this hits the semantics you were looking for before?

@iravid iravid merged commit 97f4df6 into zio:master May 17, 2020
@reibitto
Copy link
Contributor

@iravid @luis3m Hmm, I think there's one corner case still left with the handling of the end of a stream. I expect the following to result in List(3), but right now it's an empty list:

ZStream(1, 2, 3).fixed[Any](500.millis).debounce(1.second).runCollect

@iravid
Copy link
Member

iravid commented May 17, 2020

Ah ok. That should be fixed. Can you open a follow up issue?

@reibitto
Copy link
Contributor

Sure thing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

stream ZIO Stream

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants