Thanks for the examples. I ended up just using ActorSink/ActorSubscriber 
and using akka-stream exclusively for the TCP layer (actors for the rest), 
but I may go back to the stream approach if I want to integrate stream 
backpressure into the protocol's backpressure.

On Tuesday, July 14, 2015 at 9:43:39 PM UTC+3, Chad Retz wrote:
>
> I just had to do this and I found the AsyncStage which allows out-of-band 
> messages to get added to the stream. It and the DetachedStage are not yet 
> documented[0] but after reading enough other code and taking some guesses, 
> I was able to get out-of-band messages into my IMAP server via an 
> AsyncStage[1] so that it would work with IDLE[2]. Hopefully it helps.
>
> 0 - 
> http://doc.akka.io/docs/akka-stream-and-http-experimental/1.0-RC4/scala/stream-customize.html#Using_DetachedStage
> 1 - 
> https://github.com/cretz/scimap/blob/a8dd56f9c2988098e61d1e30c495ea9ed14944dd/src/main/scala/scimap/handler/ServerHandlerStage.scala
> 2 - 
> https://github.com/cretz/scimap/blob/a8dd56f9c2988098e61d1e30c495ea9ed14944dd/src/it/scala/scimap/JavaMailSpec.scala#L114
>
>
> On Wednesday, July 1, 2015 at 6:55:33 AM UTC-5, Chad Selph wrote:
>>
>> I tried something like this, where I had a PushPullStage that accepted a 
>> Source into its constructor. It seemed like the wrong approach, because it 
>> seemed like I was just reimplementing a common merge functionality.
>>
>> On Wednesday, July 1, 2015 at 3:58:49 AM UTC+3, Chad Retz wrote:
>>>
>>> Although I have not done this yet, I would assume you can do this with a 
>>> PushPullStage that pushes in onPull. How the state gets there to know when 
>>> to push in onPull is probably an implementation detail.
>>>
>>> On Monday, June 29, 2015 at 5:15:53 AM UTC-5, Chad Selph wrote:
>>>>
>>>> I'm currently rewriting a library I have that previously used akka IO 
>>>> pipelines. Reading through the examples of streaming IO with akka-stream 
>>>> and akka-http, I've only seen examples with request -> response type 
>>>> protocols.
>>>>
>>>> Currently, I have a BidiFlow that serializes/deserializes between 
>>>> ByteStrings and case classes, but I only know how to make this work in one 
>>>> direction (client makes request, server replies to request). In this 
>>>> protocol, the server can also initiate requests to the client.
>>>>
>>>> How can I "inject" a message into the BidiFlow that isn't just a 
>>>> response to a client request? I understand at a high level the solution is 
>>>> probably to make a Graph with another Source pointing to my serializer, 
>>>> but 
>>>> I've had a tough time wrapping my head around the graph DSL. If someone 
>>>> could point me to an example of something similar, I'd very much 
>>>> appreciate 
>>>> it.
>>>>
>>>

-- 
>>>>>>>>>>      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 http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to