Hi Victor,

Embedding is not the way to think about this. What you really want is a
BidiStage which then can be composed by any Flow to get a new Flow.

-Endre

On Thu, Sep 1, 2016 at 10:12 AM, Victor <victor.pi...@iadvize.com> wrote:

> Hi,
>
> Is it possible to embed a Flow in a GraphStage?
>
> I want to design a GraphStage which monitor a flow given by a user (pseudo
> code):
>
> class MyFlow(embededFlow: Flow[MyMessage, MyMessage, NotUsed]) extends
> GraphStage[FlowShape[MyContent, MyContent]] {
>
>   var id
>
>   onPush = {
>     val msg = grab(in)
>     id = msg.id
>     push(embededFlow.in, msg.content)
>   }
>
>   onPull = {
>     val content = grab(embededFlow.out)
>     push(out, MyMessage(id, content))
>   }
>
>   embededFlow.onFailure = {
>     push(out, ...)
>   }
>
> }
>
>
> The embeded flow is a black box and I want to monitor it, react to it's
> failure and manage a state because I don't want to expose the whole message
> to the embeded flow, I just want it to process a part of the message.
>
> Is it possible?
>
> Thanks in advance,
> Victor
>
> --
> >>>>>>>>>> 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.
>

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