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

Using Task Scheduling API #562

Open
AMontagu opened this issue Apr 18, 2024 · 2 comments
Open

Using Task Scheduling API #562

AMontagu opened this issue Apr 18, 2024 · 2 comments
Labels
feature Request a new feature

Comments

@AMontagu
Copy link
Contributor

Description

Web browsers implement an task scheduling api: https://developer.mozilla.org/en-US/docs/Web/API/Prioritized_Task_Scheduling_API

It may be interesting to use it to create/send log as they are not critical to the application. Maybe there is already a similar system in faro but I didn't find one.

This is really not urgent but may be an interesting improvement for heavy loading application.

Important to note that an other solution that may be in the process and replace this need is the usage of web worker so the log are sended in another thread but it may be way more complicated to implement.

Proposed solution

Using the postTask with "background" priority for all logging.

@AMontagu AMontagu added the feature Request a new feature label Apr 18, 2024
@yulafezmesi
Copy link

would be nice if you guys doing this. i had to disable log dispatcher because of locking main thread.

@kesavkolla
Copy link

Another way to offload from main thread is to use sync API. https://developer.mozilla.org/en-US/docs/Web/API/Background_Synchronization_API

Would be nice to push data to service worker and let the worker send to backend.

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

No branches or pull requests

3 participants