Hi paweł,

you are on the right track. You need to provide the data as a 
`Source<ByteString, Object>`. Then, you can create a response like this:

Source<ByteString, Object> data = ...
HttpResponse response = 
HttpResponse.create().withEntity(HttpEntities.createChunked(contentType, 
data));

If you know the length of the data (i.e. the aggregated number of octets in 
all the ByteStrings the Source provides), you can also use

HttpEntityies.create(contentType, length, data)

to create a (non-chunked) streamed default entity.

HTH
Johannes



On Monday, August 10, 2015 at 10:38:40 PM UTC+2, paweł kamiński wrote:
hi,
probably again I ve overlooked it in documentation but I cannot find a way 
to respond to a http request with streamed response. probably 
HttpEntityChunked should be used but again I cannot figure out how to set 
entities and flows correctly.


this is basic example


private RouteResult getEvents(RequestContext ctx)
{

final Source<Integer, BoxedUnit> source = producer.produce(10, 100);
return ctx.complete(HttpResponse.create());
}


thanks for any hint on that

-- 
>>>>>>>>>>      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 [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to