open-rmf / open-rmf/crossflow

[Feature request]: Enable using .spawn_continuous_service via mut Command via proxy systems

Open
#92 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Rust
Stars
72
Forks
16
PR merge metrics
No merged PRs in 30d

Description

Before proceeding, is there an existing issue or discussion for this?
Description

Curently, .spawn_continuous_service can only be used through &mut App which is problematic for enabling services on a "per-need basis". E.G:

if you had a Service that dependent on a picking service:

pub struct PickingService(Service<(), ()>);

... inside a plugin init
  let picking_service = self.spawn_continuous_service(
      Update,
      picking_service::<F>.configure(|config: ScheduleConfigs<ScheduleSystem>| {
          config.in_set(SelectionServiceStages::Pick)
      }),
  );

You would either need a singleton plugin for this service ,or make a create a large resource that contains this service + a lot of other unrelated services.

to reduce .add_plugin spam and to allow initializing services via cascading FromWorlds, systems could be run within bevy_impulse via a proxy system that iterates over registered app schedules(similar to type registry) and runs systems via SystemIds.

E.G: Something along the lines of this example:
https://github.com/rydb/bevy_proxy_system/blob/main/src/main.rs

Implementation Considerations

No response

Alternatives

No response

Additional information

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No project files or tests are named. Start by reading the current spawn_continuous_service API and the linked bevy_proxy_system example, then trace how App schedules and SystemIds are handled. Done should support the requested per-need service initialization through a bevy_impulse proxy without requiring access through &mut App.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
backend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.