Skip to content
This repository was archived by the owner on Jan 20, 2025. It is now read-only.
This repository was archived by the owner on Jan 20, 2025. It is now read-only.

Receiving multiple responses asynchronously #268

@nightscape

Description

@nightscape

Hi all,

I'm trying to write a zio-actor for the originally Akka based Petri Net implementation Kagera.
The Akka implementation does one thing that I don't know how to do in zio-actors:
When an actor A sends the Petri Net actor B a command to fire a transition, B sends a corresponding TransitionResponse (that's easy to do in zio-actors), but then other transitions can automatically fire and in the Akka implementation this sends additional TransitionResponses back to A asynchronously whenever the automatic transitions have fired (corresponding test).
Afais, a Stateful actor never gets to know the actor who sent it a message, so just sending A an additional TransitionResponse via ! won't work.
The only idea I have for implementing this in zio-actors is to return a Seq[TransitionResponse], but that means that one has to await all transitions to finish before sending the response.

I hope this is understandable without knowing too much about Petri Nets.

Is there any way to get something like this to work?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions