Skip to content
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

feat: Add emitMulti with Spliterator support #1776

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

He-Pin
Copy link
Member

@He-Pin He-Pin commented Feb 22, 2025

Motivation:
Add Spliterator support for emitMulti, reducing overhead when working with java stream.

Result:
less overhead

I would like rebase #1775 on this.

@He-Pin He-Pin added the t:stream Pekko Streams label Feb 22, 2025
@He-Pin He-Pin added this to the 1.2.0-M1 milestone Feb 22, 2025
@He-Pin He-Pin modified the milestones: 1.2.0-M1, 1.2.0-M2 Feb 22, 2025
@He-Pin
Copy link
Member Author

He-Pin commented Feb 24, 2025

@pjfanning Would you like to take a look at this, thank.

@pjfanning
Copy link
Contributor

@pjfanning Would you like to take a look at this, thank.

Can you give some background on who needs this? Is it intended that anyone can use this or do you just want it for #1775?

@He-Pin
Copy link
Member Author

He-Pin commented Feb 25, 2025

@pjfanning Would you like to take a look at this, thank.

Can you give some background on who needs this? Is it intended that anyone can use this or do you just want it for #1775?

For now, only in #1775 , but it's generally

@pjfanning
Copy link
Contributor

pjfanning commented Feb 25, 2025

the code is protected - so other users won't easily be able to access it

* is needed and reinstalls the current handler upon receiving an `onPull()`
* signal (before invoking the `andThen` function).
*/
final protected def emitMultiple[T](out: Outlet[T], elems: Spliterator[T], andThen: () => Unit): Unit = {
Copy link
Member Author

Choose a reason for hiding this comment

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

@pjfanning It the same access level as the other emitMultiple method, its been used in a sub class of GraphStage

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
t:stream Pekko Streams
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants