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

[Question] Why need to execute on main thread? #427

Open
ghost opened this issue Mar 16, 2023 · 3 comments
Open

[Question] Why need to execute on main thread? #427

ghost opened this issue Mar 16, 2023 · 3 comments

Comments

@ghost
Copy link

ghost commented Mar 16, 2023

Hi there,

I'm reading the latest source code and wondering why it requires running on the main thread. For example:

  • MatomoTracker's func queue(event: Event) and func dispatchBatch()
  • MemoryQueue's functions

I'm worrying that there may be a UI glitch while a huge amount of events are queued in a short period.

If the reason for using the main thread is for its serial queue, then can we use a serial background queue instead? The enqueue/dequeue/network functions should be fine running on a background thread, or is there any reason I'm not aware of?

@brototyp
Copy link
Member

Hi @nelson-dai-17Live, you are correct, it doesn't have to be the main thread. We could move this al into a single, serial background queue instead.

@ghost
Copy link
Author

ghost commented Mar 22, 2023

@brototyp Thanks for your kind reply, may I know if there is any timeline for this enhancement?

@brototyp
Copy link
Member

Hi @nelson-dai-17Live, there is not timeline for it now.

I am open for PRs on this any am happy to collaborate.

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

No branches or pull requests

1 participant