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

Replace statefulMapConcat with statefulMap + mapConcat in codebase #395

Closed
mdedetrich opened this issue Jan 3, 2024 · 11 comments · Fixed by #311
Closed

Replace statefulMapConcat with statefulMap + mapConcat in codebase #395

mdedetrich opened this issue Jan 3, 2024 · 11 comments · Fixed by #311

Comments

@mdedetrich
Copy link
Contributor

As the title suggests, statefulMapConcat is deprecated so it should replaced with statefulMap + mapConcat so that the 1.1.0 version of pekko-http isn't relying on deprecated pekko methods.

@mdedetrich mdedetrich added this to the 1.1.0 milestone Jan 3, 2024
@laglangyue
Copy link
Contributor

also found in pekko-connectors

@mdedetrich
Copy link
Contributor Author

also found in pekko-connectors

Thanks, issue created at apache/pekko-connectors#307

@pjfanning
Copy link
Contributor

#311 was merged already but a quick search indicates that we might still have 1 or 2 remaining uses.

@He-Pin
Copy link
Member

He-Pin commented Jan 10, 2024

I did a check seems there are no usage now. @pjfanning , the only lefts are in scaladoc and benchmarks

@jrudolph
Copy link
Contributor

This might have performance implications (mapConcat had performance issues in the past) so make sure to benchmark before doing these changes.

@pjfanning
Copy link
Contributor

This was deprecated in apache/pekko#601 - if we think deprecating the code was a mistake then we can reopen that discussion. If we think it was the right decision to deprecate statefulMapConcat, then we should start removing its usage.

@jrudolph
Copy link
Contributor

I like the change from an API orthogonality perspective, just saying that it might not come for free. In the worst case, it could be possible to keep a copy in StreamUtils, but better if that is not needed.

@He-Pin He-Pin linked a pull request Jan 30, 2024 that will close this issue
@He-Pin
Copy link
Member

He-Pin commented Jan 30, 2024

I think this issue can be closed as the associated change has been one. in #311.

Or we can do some dedicated implementation just for pekko-http usage in StreamUtils, without any additional allocations.

@He-Pin
Copy link
Member

He-Pin commented Jan 30, 2024

The current statefulMap or mapAccumlate implementation will need a (S, A) , which is a kind of allocation, in JEP https://openjdk.org/jeps/461 @viktorklang @viktorklang-ora is using an object which reducing this allocation.

@He-Pin
Copy link
Member

He-Pin commented Jan 30, 2024

@jrudolph I will review the changes and try to come up with an allocation-free implementation in pekko-http.

@pjfanning
Copy link
Contributor

I'm going to close this because we undeprecated statefulMapConcat. Feel free to reopen.

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 a pull request may close this issue.

5 participants