View on GitHub

PHATDocs

Documentation for https://github.com/chgibb/phat

Home

For 0.11.0

Contents

Overview

PHAT is built against the Electron framework using (primarily) Typescript. Familiarity with both Electron, Node and Typescript is assumed.

PHAT makes heavy use of the process model of Electron, that is, separate renderer processes communicating with a single main process.

PHAT takes this one step further with the use of atomic operation processes. That is, some operation (such as performing an alignment) which is run and managed in its own separate process. The main process will manage the lifecycle and artifacts generated by the operation but the operation is otherwise isolated. If the operation fails or otherwise crashes, the main process is able to clean up artifacts and data from the operation without damaging the state of the application. This model is used to try to ensure the stability and responsiveness of the application.

Many operations (such as opening a project, or running an alignment) are multi step tasks which make heavy use of and in some cases require synchronization of the file system. PHAT integrates closely with third party applications which in cases require a high degree of data piping and manipulation. All these things serve to clutter the main process’ event loop which degrades application responsiveness as window events such as mouse clicks, moves and focus/unfocus all fire events which must wait for a response from the main process. By isolating all these things into their own processes, it ensures that the main process remains uncluttered and the application responsive. It also ensures that things like out of memory exceptions or extreme failure cases will take out the process involved, as opposed to the entire application.

This isolation is reflected in the bundling of application code as well. Attempting to keep each process’ bundle as small as possible ensures fast startup of the application itself as well as individual application windows. This is combined with the use of ahead of time bundle compilation using V8’s code caching feature. See also PHAT’s code caching module.

Next: Contributing

Contents