Skip to content

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

Description

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?

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions