Skip to content
This repository was archived by the owner on Aug 26, 2022. It is now read-only.
This repository was archived by the owner on Aug 26, 2022. It is now read-only.

SideEffects as Broadcast #122

@sleipnir

Description

@sleipnir

Today by the Cloudstate protocol you can emit many side effects (a list of them) but the proxy handles each side effect call individually.
It would be interesting to allow the user role to emit a side effect for all entities registered in each of the Nodes of the cluster of a certain type. That is, to allow a call in Broadcast mode to be possible.

For that I see that we would have to change the SideEffect message to include a boolean flag to indicate this behavior. Something like:

// A side effect to be done after this command is handled.
message SideEffect {

    // The name of the service to perform the side effect on.
    string service_name = 1;

    // The name of the command.
    string command_name = 2;

    // The payload of the command.
    google.protobuf.Any payload = 3;

    // Whether this side effect should be performed synchronously, ie, before the reply is eventually
    // sent, or not.
    bool synchronous = 4;

    // Send side effect to all entities of the given type.
    bool broadcast = 6;

    // The metadata to include with the side effect
    Metadata metadata = 5;
}

``

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions