Skip to content

EventReader iter can skip events if interrupted #1157

Closed
@alice-i-cecile

Description

@alice-i-cecile

Bevy version

0.4

Operating system & version

Ex: Windows 10, Ubuntu 18.04, iOS 14.

What you did

Ran the example here: https://github.com/alice-i-cecile/understanding-bevy/blob/afe2d7dff009037f2f272c0dff18fab14af64aa2/src/ecs/systems-queries_code/examples/concurrency.rs

What you expected to happen

Each event should be processed in order.

What actually happened

Most events are skipped, because the system runs out of time to process them and EventReader.iter() updates its internal counter all the way to the end of the current queue. This is documented but is surprising behavior that is likely generally unhelpful.

Additional information

Exposing the current length of the EventReader would also be helpful for similar tasks :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-FeatureA new feature, making something new possible

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions