-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Akka.Streams: add PreMaterialize support for Sources #3476
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 PreMaterialize support for Sources #3476
Conversation
docs/articles/streams/basics.md
Outdated
|
||
### Source pre-materialization | ||
There are situations in which you require a `Source` materialized value **before** the `Source` gets hooked up to the rest of the graph. | ||
+This is particularly useful in the case of "materialized value powered" `Source`s, like `Source.Queue`, `Source.ActorRef` or `Source.Maybe`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A + too much
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whoops, good catch.
docs/articles/streams/basics.md
Outdated
Tuple<TaskCompletionSource<int>, Source<int>> materialized = matValPoweredSource.PreMaterialize(Sys.Materializer()); | ||
var tcs = materialized.Item1; | ||
var nextSource = materialized.Item2; | ||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It’s probably fine to include this code directly in the .md since all the other code examples are here as well, but in general haven’t we agreed on using the document projects for code examples ?!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@marcpiechura yeah, we try to do that for the most part going forward but we don't have anything organized for that in Akka.Streams itself at the moment. I'd personally prefer to do something that is compile-time checked and there referred to via DocFx's source code embedding, akin to https://github.com/akka/akka/pull/24497/files#diff-96bb38a1bfc1933567a890af8f3d0263
But starting the infrastructure for that is a bigger project than adding just this one feature. So question for you is: start building the infrastructure now or throw yet one more thing on the future technical debt pile for later? I'm opted for the latter (obviously) but, if there's buy-in from other folks to go down the route of doing something similar to what the JVM does then I'd be all for it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Welp, I was wrong about this - we do have support for this built into the project already. Just uploaded some changes which incorporate it.
@marcpiechura I think I addressed all of your comments in the newest commit. |
@Aaronontheweb there is still the ++ in the readme ;-) |
@marcpiechura damn, thought I got it - just fixed... again :p |
Port of akka/akka#24497