You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I choose to split it up into two processes. The first one handles the user-side of things, tracking, permission, etc. When a user wants to track a path, they call .track() which then parses and adds it to the queue, and then calls ._save which is responsible for messaging the record to the second process push.js. The reason for the queue is to be able to handle bursts of consecutive track() calls by combining the queue with debouncing.
The second process is responsible for getting messages with queues and handling them. It does this by reading the saved queue, merging it with the live queue, then deleting the saved queue, and then trying to send the whole queue out. If it fail, in case of eg. offline, it will save the queue again.
The reason for the split is separation of concern and the benefit that the sending of stats will never influence the application using the lib. If I hadn't done that, a slow internet connection could potentially slow down parts of the app.
Records are saved in a YAML file using our own configstore module.
Need more docs when the Analytics API is public.
The text was updated successfully, but these errors were encountered: