Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EventReciever method, that would return all the latest event asynchronously. (ReceiveAllAsync() wanted) #2572

Open
delustra opened this issue Dec 21, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@delustra
Copy link

Is your feature request related to a problem? Please describe.
In Stride.Engine.Events, there is are sync methods TryReceive and TryReceiveAll. However for async there is only ReceiveAsync(). The problem is that, if there are several events of that type, regular ReceiveAsync() would only return one, while others would get lost. It requires additional code to be created. Something like:

do {
        var data= await EventReceiver.ReceiveAsync();
      } 
while (EventReceiver.Count > 0);

Describe the solution you'd like
ReceiveAllAsync() - the method that will return a collection of all items. That would be clean, predictable and nice.

@delustra delustra added the enhancement New feature or request label Dec 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant