> On 18 Feb 2018, at 3:18 pm, Christopher Hunt <hunt...@gmail.com> wrote: > > It just occurred to me that compound types might be the way to solve this eg > `new Element with OOB[Span]`. I shall experiment further... and then PR the > Akka stream doco with a section on OOB/instrumentation if there’s interest. > I’m very interested to hear about what others think though.
On further reflection, I don’t think that compound types really help that much given that it takes effort to deconstruct/reconstruct them through various transformations (map etc.). Also, I was wrong to name this topic in relation to “out of band data”. In hindsight, I really meant element metadata. OOB is a separate signalling mechanism. I remain curious as to whether an Akka streams API along the lines of the materialisation API has been considered for carrying additional data with an element to avoid polluting code. Here’s a bit of (untested) code illustrating my thinking by way of a solution: Source .single("hi") .mapMetadataValue(_ => hiStartedEvent) ... .viaMeta(hiEndedEvent) …where `hiStartedEvent` starts/returns a OpenTracing Span and `hiEndedEvent` takes a single arg of a Span and ends it. Of course, it doesn’t have to be a Span carried through… it could be any metadata you can imagine. Thanks! -C -- >>>>>>>>>> Read the docs: http://akka.io/docs/ >>>>>>>>>> Check the FAQ: >>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html >>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user --- You received this message because you are subscribed to the Google Groups "Akka User List" group. To unsubscribe from this group and stop receiving emails from it, send an email to akka-user+unsubscr...@googlegroups.com. To post to this group, send email to akka-user@googlegroups.com. Visit this group at https://groups.google.com/group/akka-user. For more options, visit https://groups.google.com/d/optout.