Re: [akka-user] Re: Trigger some logic at the moment of TCP connection established

2016-09-20 Thread Viktor Klang
Vouldn't you prepend *after* the via? -- Cheers, √ On Sep 20, 2016 4:21 PM, "'Johannes Rudolph' via Akka User List" < akka-user@googlegroups.com> wrote: > Hi Yaroslav, > > you may want to create a custom GraphStage in that case that waits for the > first data to arrive and then prepend the

[akka-user] Re: Trigger some logic at the moment of TCP connection established

2016-09-20 Thread Yaroslav Klymko
Thanks Johannes On Tuesday, September 20, 2016 at 5:21:11 PM UTC+3, Johannes Rudolph wrote: > > Hi Yaroslav, > > you may want to create a custom GraphStage in that case that waits for the > first data to arrive and then prepend the extra-data. Afterwards you can > change the state of the

[akka-user] Re: Trigger some logic at the moment of TCP connection established

2016-09-20 Thread 'Johannes Rudolph' via Akka User List
Hi Yaroslav, you may want to create a custom GraphStage in that case that waits for the first data to arrive and then prepend the extra-data. Afterwards you can change the state of the GraphStage to forward messages 1-to-1. Johannes On Tuesday, September 20, 2016 at 4:00:23 PM UTC+2, Yaroslav

[akka-user] Re: Trigger some logic at the moment of TCP connection established

2016-09-20 Thread Yaroslav Klymko
Basically I'd like to prepend something, but at the moment first ByteString received, I mean that prepended value should not be in the stream in case of connection failure. On Tuesday, September 20, 2016 at 1:44:56 PM UTC+3, Johannes Rudolph wrote: > > Hi Yaroslav, > > no worries, this is a

[akka-user] Re: Trigger some logic at the moment of TCP connection established

2016-09-20 Thread 'Johannes Rudolph' via Akka User List
Hi Yaroslav, no worries, this is a good question. It depends a bit on what kind of logic you want to trigger. If you just want to do something, you can use `mapMaterializedValue` to do something with the `OutgoingConnection` object before materialization is complete. If you want to prepend

[akka-user] Re: Trigger some logic at the moment of TCP connection established

2016-09-15 Thread Yaroslav Klymko
Either my question is silly or there is no easy answer. On Saturday, September 10, 2016 at 3:57:33 PM UTC+3, Yaroslav Klymko wrote: > > Hi guys, > > I'm trying to figure out on how to trigger some logic at the moment TCP > connection established, and preferably *before traffic goes* > Initial