I'm trying to send a query to the database with akka-streams' Tcp client, but i don't understand what i am missing.
So i have two types Query and Response that are perfectly convertable to and from akka's ByteString. So i'm creating a client connection with val conn = Tcp().outgoingConnection("localhost", 28015), which gives me a Flow[ByteString, ByteString, Future[OutgoingConnection]], so far so good. So i assume that source is my request with the query, i couldn't find the best way to feed this flow with a query source, but to construct it like Source(Future.successful(query)), and connect it to the flow source.via(flow), which gives me another Source[Response, Unit]. And here i can't understand how to get Future[Response], tried several combinators, but it gives me Materialized value, which i'm not fully understand how it relates to the values/types in the flow.