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

Added stages responsible for streams context propagation #3741

Merged
merged 10 commits into from
Aug 7, 2019

Conversation

Horusiath
Copy link
Contributor

@Horusiath Horusiath commented Mar 20, 2019

Port of feature from: akka/akka#25951

This allows to implicitly pass a some object as an implicit context of execution between stages, without exposing it on the majority of the stages. IMHO the major use cases are all kinds of persistent queues, which require explicit commit, after message was processed throughout the stages. In that case we'd like to pass message context/id (necessary for commit), but without seeing it in our business domain stages, that have no interest with it.

Example:

AmazonSQS.Source()
   .Select(msg => (msg.MessageRef, msg.Body))
   .AsSourceWithContext(tuple => tuple.Item1))
       .Select(str => JsonConvert.DeserializeObject<MyMessage>(str))
       // do some other processing 
   .AsSource()
   .SelectAsync(4, tuple => AmazonSQS.CommitAsync(tuple.Item2))
   .To(Sink.Ignore<Tuple<MyMessage, string>>())
   .Run(materializer);

@Aaronontheweb Aaronontheweb added this to the 1.4.0 milestone Jun 26, 2019
@Aaronontheweb
Copy link
Member

I've very excited about this feature, btw

@Horusiath
Copy link
Contributor Author

I think naming needs to be updated - some time after I've ported this feature Lightbend decided to change names in the API.

@Aaronontheweb
Copy link
Member

Aaronontheweb commented Jul 9, 2019 via email

@Horusiath
Copy link
Contributor Author

I'll try, it should be just a naming convention change + maybe few new stages added there.

@Aaronontheweb
Copy link
Member

@Horusiath sounds good, we'll get that out in the next beta.

@Aaronontheweb
Copy link
Member

@Horusiath I'm going to work on the API renaming in a new PR this week - along with updating the APIs for the StreamRefs. I'll address those separately shortly.

@Aaronontheweb Aaronontheweb merged commit ed02407 into akkadotnet:dev Aug 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants