Open AMontagu opened 5 months ago
would be nice if you guys doing this. i had to disable log dispatcher because of locking main thread.
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.
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.