AlexAegis / AlexAegis/rx_bevy

Cleanup: Use the teardown/exit schedule (once it exists) to mass unsubscribe active subscriptions

オープン
#2 コメント 0 件 リアクション 0 件 担当者 1 名 @AlexAegis が担当を希望しています GitHub で見る
blocked (bevy-0.18) cleanup enhancement
主要言語
Rust
スター
25
フォーク
2
PR マージ指標
30日以内にマージされた PR はありません

説明

Upstream issue: https://github.com/bevyengine/bevy/issues/7067

The teardown logic of observable pipelines must be reliable, they must be ran exactly once during their lifetime.

Which during the runtime of the app is trivial with an on_remove hook. But entities aren't despawned when the app exits, the app just closes.

Currenly rx_bevy does the next best thing and unsubscribes everything in an exclusive system ran after the AppExit event is written.

```rs
app.add_systems(
Last,
unsubscribe_all_subscriptions
.after(exit_on_all_closed) // from `bevy_window::system`
.run_if(on_event::),
);
```

> Note that while this is an okay-ish solution as long as the app is closed with this event, I've yet to see how this affects sub-apps.

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。