#Can I read events without consuming them ?

15 messages · Page 1 of 1 (latest)

ember glen
#

probably through ResMut<Events> 🔍

dull prawn
#

yeah, or make a run condition for the event reading system so that it doesn't even run until you want it to run and read the events.

ember glen
#

I might be in a situation where I want to consume some events though 💀

#

I think I'll refactor a bit to add an "eventQueue" component to my entity, waiting to be consumed when ready.

dull prawn
#

yeah, especially if this event queue doesn't need to be read by anything else or is just for a specifc thing, it can easily just be a vec.

civic veldt
dull prawn
#

yeah but with normal events you can self-manage them by opting out of this two frame clear.

civic veldt
#

By “normal” I meant those added with add_event which I don’t think you can opt out of (could be wrong)

ember glen
#

in my case I eventually ruled into accepting that some events might be dropped, I'll consider the user responsible for missed event, and he should re-emit them 😅

dull prawn
#

obviously if you use add_event its opting in, so you were correct to say that. just clarifying that its all using Events<T>

civic veldt
#

Ah, yeah I could’ve been more clear. They’re all events at the end of the day. It’s how you initialize the resource that matters (since add_event also initializes the automatic cleanup systems)

zenith crescent