Sorry in fact it's working good, but I'm still wondering if there is a 
simpler/better way to achieve this, without using a Publisher?

Thanks

Loïc

Le samedi 6 février 2016 10:58:40 UTC+1, Loïc Descotte a écrit :
>
> Hi,
>
> Source.queue seems perfect to push elements dynamically into a source. 
>
> I am using Akka Streams 2.0 with Play framework (2.5-M2).
>
> In Play 2.5, the controller's 'chunked' method can take an Akka Streams 
> Source to stream elements to the browser.
> In other words Play defines its own Sink and I can't run a sourceQueue 
> into a Sink by myself.  
>
> So I've tried this to create a dynamic source : 
>
> val (queue, pub) = Source.queue[String](10, 
> OverflowStrategy.fail).toMat(Sink.asPublisher(false))(Keep.both).run()
> val tick = Source.tick(0 second, 1 second, "tick")
> tick.runForeach(t => queue.offer("tick"))
>
> Ok.chunked(Source.fromPublisher(pub))
>
> Sink.asPublisher is the only way I've found to materialize the source and 
> keep a reference to it. But I find this a little verbose more important, 
> it's not working, the browser is loading forever and no element is emitted. 
>
> So is there a proper way to retrieve a source from Source.queue?
>
> Thanks a lot
>
> Loï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.

Reply via email to