Hi Endre,

Yes I think it will be very useful. Though I currently can easily send messages in my akka cluster, I can't orchestrate a process that requires multiple messages to be send via several actors and the receipts to be collected. Doing so with just a series of messages becomes tedious (a lot of testing and the intent of the code is lost).

I did an impl so far of a flow engine, using an FSM actor. It makes msg exchange as a flow that takes an input (Sync of an index creation operation), sends it around the cluster, expects 1 reply from each remote actor and sends a msg to the master actor on success or a timeout msg (to all remote actors & master) on failure. Kind of like

val keepers:Seq[Future[ActorRef]] = *... actor refs obtained via context.actorSelection(path).resolveOne(timeout)*
            val flow=Flow.start(5 seconds)
                .sendToAllF(keepers)
                .expectNMessages(keepers.size) {
                    case SyncAck(index)=>
                        ..... got ack
                }

             flow.execute(SyncAck(index))
                .onSuccess { in=>
                    ...
                }.onTimeout {
                    ...
                }



On 07/06/15 11:13, Akka Team wrote:
Hi Kostas,

Currently there is no such DSL, but this is actually something we already started experimenting with. I hope that we can come up with something easy to use in the near future.

-Endre

On Mon, Jun 1, 2015 at 5:09 PM, Kostas kougios <[email protected] <mailto:[email protected]>> wrote:

    Hi, I need to create a flow of messages, my current usecase is
    that I get a msg in one of my actors which in turn has to send a
    similar message to the cluster (I am also using akka-cluster) and
    upon confirmation from all cluster members to do some local
    changes and then reply back to the sender. But my use case might
    become more complex in the future.

    So apart from using a separate FSM actor (my current actor is not
    FSM), is there any higher level api that can do

    broadcast(msg).expectFromAll { case Reply=> true }.andThen(... do
    local changes...).andThen(reply to sender).onTimeout(...fail...)

    a bit of googling didn't reveal anything like that.

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




--
Akka Team
Typesafe - Reactive apps on the JVM
Blog: letitcrash.com <http://letitcrash.com>
Twitter: @akkateam
--
>>>>>>>>>> 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 a topic in the Google Groups "Akka User List" group. To unsubscribe from this topic, visit https://groups.google.com/d/topic/akka-user/GWaCwMQDqTM/unsubscribe. To unsubscribe from this group and all its topics, send an email to [email protected] <mailto:[email protected]>. To post to this group, send email to [email protected] <mailto:[email protected]>.
Visit this group at http://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 [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