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 code looks like this:
>
>
> Tcp(system).outgoingConnection(???, ???).join(flow).runWith(source, sink)
>
>
>
> As far as I can see I need to access Future[OutgoingConnection]
>
>
> val outgoingConnection: Flow[ByteString, ByteString, 
> Future[OutgoingConnection]] = Tcp(system).outgoingConnection(???, ???)
>
>
>
> So far I came to:
>
>
> val (_, connected: Future[Tcp.OutgoingConnection], _) = 
> Source.fromGraph(source).viaMat(connection)(Keep.both).toMat(sink)(Keep.both).run()
>
>
>
> Question 1: how to guarantee my code performed before first ByteString 
> came?
> Question 2: is there better solution
> Question 3: how to prepend connection as first event in the flow of 
> ByteStrings ?
>
>

-- 
>>>>>>>>>>      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.

Reply via email to