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

Akka Streams: add collectType operator for easier casting in streams #24254

Closed
hepin1989 opened this Issue Jan 5, 2018 · 7 comments

Comments

Projects
None yet
3 participants
@hepin1989
Contributor

hepin1989 commented Jan 5, 2018

with cast we could write :

cast(食材.class)

instead of

map(食材.class::cast)
@ktoso

This comment has been minimized.

Show comment
Hide comment
@ktoso

ktoso Jan 5, 2018

Member

Please please please be more specific in your issues @hepin1989 😉
I'm guessing you mean such operator for Akka Streams? I've thought of it a few times...
Worth considering 👍

Would you PR it?

Member

ktoso commented Jan 5, 2018

Please please please be more specific in your issues @hepin1989 😉
I'm guessing you mean such operator for Akka Streams? I've thought of it a few times...
Worth considering 👍

Would you PR it?

@ktoso ktoso changed the title from add cast function as a helper function for cast to Akka Streams: add cast operator for easier casting in streams Jan 5, 2018

@ktoso ktoso added the t:stream label Jan 5, 2018

@johanandren

This comment has been minimized.

Show comment
Hide comment
@johanandren

johanandren Jan 5, 2018

Member

When is it that you need to cast?

Shouldn't it rather be a filter+map based on type then, like a Java-version of what you can do in Scala with .collect { case t: Type => t }?

Member

johanandren commented Jan 5, 2018

When is it that you need to cast?

Shouldn't it rather be a filter+map based on type then, like a Java-version of what you can do in Scala with .collect { case t: Type => t }?

@ktoso

This comment has been minimized.

Show comment
Hide comment
@ktoso

ktoso Jan 5, 2018

Member

Yeah what you propose would be nice; like a filterType[] / filterType(clazz).
The other one could be seen like a fail fast -- it's basically the mapTo on our Ask isn't it?

Member

ktoso commented Jan 5, 2018

Yeah what you propose would be nice; like a filterType[] / filterType(clazz).
The other one could be seen like a fail fast -- it's basically the mapTo on our Ask isn't it?

@hepin1989

This comment has been minimized.

Show comment
Hide comment
@hepin1989

hepin1989 Jan 5, 2018

Contributor

I am sorry,it's for the Java api .

https://github.com/hepin1989/N-ways-to-cook-JianBingGuoZi/blob/master/src/main/java/reactive/akkastream/JBGZ.java

I was demonstrating 7 ways to cook a pancake and found sometimes the API of Akka stream's Java API could improve a little.

Contributor

hepin1989 commented Jan 5, 2018

I am sorry,it's for the Java api .

https://github.com/hepin1989/N-ways-to-cook-JianBingGuoZi/blob/master/src/main/java/reactive/akkastream/JBGZ.java

I was demonstrating 7 ways to cook a pancake and found sometimes the API of Akka stream's Java API could improve a little.

@hepin1989

This comment has been minimized.

Show comment
Hide comment
@hepin1989

hepin1989 Jan 5, 2018

Contributor

@johanandren in Java you can't assign an Source to Source , so that's why I need it.

image

Contributor

hepin1989 commented Jan 5, 2018

@johanandren in Java you can't assign an Source to Source , so that's why I need it.

image

@ktoso ktoso added this to the 2.5.10 milestone Feb 21, 2018

@ktoso ktoso removed the 3 - in progress label Feb 21, 2018

@ktoso ktoso changed the title from Akka Streams: add cast operator for easier casting in streams to Akka Streams: add collectType operator for easier casting in streams Feb 21, 2018

@ktoso

This comment has been minimized.

Show comment
Hide comment
@ktoso

ktoso Feb 21, 2018

Member

Merged collectType

Member

ktoso commented Feb 21, 2018

Merged collectType

@ktoso

This comment has been minimized.

Show comment
Hide comment
@ktoso

ktoso Feb 21, 2018

Member

Oh, thanks for closing

Member

ktoso commented Feb 21, 2018

Oh, thanks for closing

@ktoso ktoso removed the 3 - in progress label Feb 23, 2018

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