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

Why use an ArrayList to store events instead of queue? #668

Open
ice-coffee opened this issue May 30, 2021 · 2 comments
Open

Why use an ArrayList to store events instead of queue? #668

ice-coffee opened this issue May 30, 2021 · 2 comments

Comments

@ice-coffee
Copy link

In source code, BackgroundPoster and HandlerPoster use PendingPostQueue to store events, but in EventBus use ArrayList to store events. Why not use the same queue as Handler?

@snuweb
Copy link

snuweb commented Oct 14, 2022

i think they are two different problems.

@tomridder
Copy link

In source code, BackgroundPoster and HandlerPoster use PendingPostQueue to store events, but in EventBus use ArrayList to store events. Why not use the same queue as Handler?

the reason of use arraylist is it only need to store the events , and traverse the eventTypes to get the event ,then give the event to subscriptionsByEventType ,finally get the subscriptionList.

he don't have to keep the order of first-in first-out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants