| Home | Parent | ← Go → | Prior | Next |
In order to not slow down your Mac and your internet connection with frivolous processing, BookMacster and Online File Syncing Services such as Dropbox are designed to coalesce changes and sync lazily. Changes from one Client to another on a local Mac may take up 5 minutes, and changes to Clients on another Mac may take up to 8 minutes to appear, even when both have a continuous internet connection.
This works fine as long as you only work on one Mac at a time. If you feel you know what you’re doing and want syncing to be faster, you can change the hidden preference bookmarksChangeDelay2 to a lower number of seconds. Values below 60 seconds will be interpreted as 60. With this value, syncing should occur within 2 minutes on the local Mac and 5 minutes to your other Macs. The latter time depends greatly on your Online File Syncing Service, i.e. Dropbox™.
BookMacster’s Agents are based on the launchd facility of Mac OS X. An BookMacster Agent is implemented by one or more launchd agents, which are file(s) in the directory
~/Library/LaunchAgents/
The launchd agent files are either trigger files, or a special quit watch file.
A trigger file implements a single Trigger in a single Agent, and has a name of the form
com.sheepsystems.BookMacster.XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX.YYY.ZZZ.plist
The part with all the XXXs is the unique identifier of the Bookmarkshelf on whose behalf it acts. The YYY is three decimal digits saying which agent in the Bookmarkshelf this launchd agent is acting for, and the ZZZ is similarly three decimal digits saying which trigger it implements. The YYY and ZZZ begin with 000 for the first agent or trigger in the table, 001 for the second, etc.
The special quit watch file has a name of the form
com.sheepsystems.BookMacster.QuatchRunner.plist
This special file is installed whenever you save a Bookmarkshelf whose Agents contain one or more triggers that are of the browser quit trigger type. Its job is to keep running a little process which watches for browser apps to quit (because, unfortunately, launchd does not provide this service). The process it keeps running is an instance of BookMacster-Quatch which is included in the BookMacster application package.
Agents, however, do not do any actual work. When one of its triggers occurs, an Agent triggers an invisible Worker process. Technically, the Worker is a running instance of the BookMacster-Worker helper tool which is included in the BookMacster application package. It typically runs for ten seconds or so and then terminates itself, when the work is done.
First, the worker does several checks to make sure that BookMacster has not caused the trigger by an export, that another Worker is not already running, that the relevant Agent has not just been created within the last few seconds, that a Online File Syncing Service is not in the process of writing the file, etc. If all the tests pass, then the Worker determines what to do as follows…
• If BookMacster is the active application and the Bookmarkshelf which the Worker needs is open and has unsaved changes, the process is aborted.
• If BookMacster is running, and the Agent’s Bookmarkshelf is open, the Worker sends an AppleScript message to BookMacster, instructing BookMacster to perform the Commands. If the bottom of the Bookmarkshelf is visible on the screen when this happens, you may notice the progress being indicated in the Status Bar. This typically happens if you leave BookMacster open to land new bookmarks and visit existing bookmarks, as in Usage Style 3.
• If BookMacster is not running, or if BookMacster is running but the Agent’s Bookmarkshelf is not open, then the Worker opens the Bookmarkshelf and silently performs the Commands itself. If a Worker finds that a browser is running and you have set it to Force Quit if necessary, it will first try a normal Quit and Force Quit only if the normal Quit fails. In either case, after reading or writing bookmarks, the Worker will re-launch any browser that has been Quit or Force Quit.
In all cases, the Worker process terminates itself when the work is done.
Worker operations spawned by Agents will fail if you do not have permission to access the required data. For example, when you import or export bookmarks on another Macintosh User Account manually in BookMacster, BookMacster requires you to enter an administrator password. However, your Worker does not know the password, so the operation will fail. (Note: Other applications have solved similar problems by setting the setuid bit and ownership to root on their tool, but this is a security risk and so BookMacster does not do this.)
BookMacster remembers the documents in which you have set Agents. Each time you launch BookMacster, in the background, it runs through each of these and makes sure that they exist, are not in your Trash, and have not been replaced by a Online File Syncing Service update. If any of these tests fail, BookMacster removes any of their Agents. The same thing happens if an Agent cannot find its document when it tries to run.
Also, when the last Bookmarkshelf which had an Agent with a browser quit trigger type is saved without such a trigger, the quit watch file is removed and the BookMacster-Quatch process is terminated. In other words, BookMacster-Quatch only runs if one or more Bookmarkshelves need it.
| Home | Parent | ← Go → | Prior | Next |