Skip to content

Dynamic actor spawning #35

@ddrcode

Description

@ddrcode

Status

It's a heavily expected feature, so there is no debate around whether we should have it or not. But the details are highly undefined at this stage.

feature Ideas

  • supervisor allows to call add_actor after start
  • there is stop_actor or remove_actor that can be called before calling supervisor.stop();
  • actor (ctx?) can spawn another actor

Mental model / example

Think about file processing system. There are some raw files and each raw file produces multiple CSV files (depends on the content). Files are large in size, so to handle them effectively some concurrency is needed. In theory each raw file reader and each csv file writer could be an actor. In such case the writers subscribe to dynamic topics that are file names.

The dynamic actor creation here is needed, as new files may show up during the process. So actors will be created and dropped in the runtime.

In the simple form the coordinator that creates actors could use Maiko's supervisor and orchestrate initial setup and watch for the new files. In the ideal version entire logic could be moved to actors, but that would require an actor to spawn a new actor.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions