dlom / bevy-async-ecs

Bevy Async ECS
https://docs.rs/bevy-async-ecs
MIT License
18 stars 3 forks source link

feature request: expose options for managing lifecycle of `AsyncIOSystem`s #5

Closed databasedav closed 7 months ago

databasedav commented 8 months ago

this could be by making AsyncIOSystem.beacon_location public so users can manually manage the entity manually or adding such a method to AsyncWorld

i also noticed this comment

// TODO(Bevy 0.13):
// The AsyncIO and AsyncIOBeacon structs are hacks to enable sending IO to/from a system
// until Bevy 0.13 lands with https://github.com/bevyengine/bevy/pull/10380.
// When that happens, this file should be reverted to how it was in 886204a201eb94e54d85c8fb88d5cc722042d244.
// (and probably rewritten to match the refactor that got rid of operations)

so maybe this will be covered there

otherwise, i believe the beacon entity leaks?

dlom commented 7 months ago

Yes, the concept of these AsyncIO and the corresponding beacons will be entirely removed once 0.13 hits. I plan to update as soon as the new version is released.

dlom commented 7 months ago

To clarify, there will be no entities created or associated with an AsyncIOSystem. It will behave very similarly to the current AsyncSystem

databasedav commented 4 months ago

just wanted to follow up on this, so I understand that there are no entities from this library that will leak now but it looks like the bevy internal entity still leaks if not explicitly .remove_system-ed https://github.com/bevyengine/bevy/blob/2aed777435d26c357ed71cdb8c7b858de35e582e/crates/bevy_ecs/src/system/system_registry.rs#L146-L163

so i think we still need AsyncIOSystem.id to be pub so we can do async_world().apply(|world| world.remove_system(system.id))?