Skip to content

Engine.broadcast behaviour #3

Description

@zigster64

Hi, nice lib.

With the broadcast behaviour (not implemented yet ?)

Are we looking at sending that msg to all actors, or will there be a actor.subscribe() type of function to limit who receives various broadcasts

Thinking of the scenario where there are a very large number of actors, with only a small subset interested in certain broadcasted events

…..

Secondary question with broadcasts - consider the scenario where there are many “games” running, each game with many players, each player controlling many actors, and each actor subscribed to a subset of broadcast events

The “event message” could then be a complex struct such as

{
game_id: int,
player_id: int,
… other fields
}

Imagine an actor could subscribe to …

  • all messages for a given game_id, any player_id
  • only messages for a match on both game_id and player_id

This is already possible using a single message_type .. but for ergonomics it might be interesting to allow complex matching logic for subscriptions.

Performance wise - the match has to be executed at some point in the flow, so it’s just as much work doing it in the actor code as it would be doing it in the engine. Just an ergonomic nicety I think

Thoughts ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions