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

Add WebWorker Thread Support for Running Tasks #348

Merged
merged 17 commits into from
Feb 22, 2019
Merged

Commits on Feb 21, 2019

  1. Implement TaskThreadManager

    This commit implements a task manager variant that uses worker threads. A new worker is spawned for each new task that appears. All functionality should work, but hasn't been fully tested at this time.
    
    The TaskThreadManager is added to the export list for use in the
    frontend.
    pr1sm committed Feb 21, 2019
    Configuration menu
    Copy the full SHA
    129efd6 View commit details
    Browse the repository at this point in the history
  2. Fix Typos in TaskProcessManager

    THis commit fixes some various spelling typos found in the process manager files when implementing the task thread manager.
    pr1sm committed Feb 21, 2019
    Configuration menu
    Copy the full SHA
    bccedc7 View commit details
    Browse the repository at this point in the history
  3. Use Task Thread Manager

    This commit updates the frontend to support using the task thread manager. The dev environment is adjusted to use it, but more testing should occur before it is used as the default.
    
    Further, a check was added to make sure worker threads are supported before using the TaskThreadManager. If the are not supported a warning message is printed and the TaskProcessManager is used instead.
    pr1sm committed Feb 21, 2019
    Configuration menu
    Copy the full SHA
    961d858 View commit details
    Browse the repository at this point in the history
  4. Address PR Comments

    This commit addresses changes requested in PR:
    - TaskManager now has an Abort event defined. this is used instead of a string literal
    - TaskThreadManager now properly handles aborting on close
    - TaskThreadManager has changes to remove eslint errors
    - TaskThreadManager now checks for Webworker compatibliity in constructor. An error is thrown if there is no compatibility
    - TaskThreadManager and TaskProcessManager are refactored slightly to reduce code duplication
    - TaskManagerAdapter has better logic for falling back when worker threads are unavailable
    pr1sm committed Feb 21, 2019
    Configuration menu
    Copy the full SHA
    e772938 View commit details
    Browse the repository at this point in the history
  5. Restructure Manager Files

    This commit restructures manager files into their own folders. This helps visually group similar classes/files.
    pr1sm committed Feb 21, 2019
    Configuration menu
    Copy the full SHA
    8c2846e View commit details
    Browse the repository at this point in the history
  6. Consolidate Shared Transformer Code

    This commit consolidates shared code between the two scripts that ran on child contexts (either process or thread). Most the the code has been extracted out to a base class and sub classes have been created for each implementation.
    pr1sm committed Feb 21, 2019
    Configuration menu
    Copy the full SHA
    05f7a49 View commit details
    Browse the repository at this point in the history
  7. Refactor Managers to Consolidate Code

    This commit refactors similar code from the TaskProcessManager and TaskThreadManager into a new SplitContextTaskManager. This class is used as a base class for all future task managers that run in split contexts. Subclasses for processes and worker threads have been implemented and are now used by the frontend.
    pr1sm committed Feb 21, 2019
    Configuration menu
    Copy the full SHA
    416cd99 View commit details
    Browse the repository at this point in the history

Commits on Feb 22, 2019

  1. Fix SendProxy Bug

    This commit fixes a bug that prevented tasks from starting due to a typo in the send proxy side effect handler.
    pr1sm committed Feb 22, 2019
    Configuration menu
    Copy the full SHA
    a2447f0 View commit details
    Browse the repository at this point in the history
  2. Fix Launcher Object Destroyed Bug

    This commit fixes a bug due to improper handling of the launcher ipc tunnel. When the tunnel closes, the launcher now does not attempt to send any messages, which prevents a crash like this from occurring.
    pr1sm committed Feb 22, 2019
    Configuration menu
    Copy the full SHA
    9a31e0c View commit details
    Browse the repository at this point in the history
  3. Adjust TaskEvent Registration Logic

    This commit adjusts the logic surrounding registering for task events.
    Now the launcher will register for events as soon as the adapter is
    ready. This prevents any possibility of the task event chain not being
    set up properly to forward events to the frontend.
    
    This commit also hides console logs so they only show in dev mode and
    renames the manager.html file to a more appropriate launcher.html
    pr1sm committed Feb 22, 2019
    Configuration menu
    Copy the full SHA
    369011d View commit details
    Browse the repository at this point in the history
  4. Start Launcher when Transitioning to the Auth State

    This commit fixes a bug where deactivating the frontend would prevent the task launcher from starting again. A code path to launch the main window was missing the call to start the launcher as well.
    pr1sm committed Feb 22, 2019
    Configuration menu
    Copy the full SHA
    eace377 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    31582f4 View commit details
    Browse the repository at this point in the history
  6. Add Linter Exemptions for Certain Classes

    We have a requirement to use instance methods within the Transformer subclasses, but the implementations don't use `this`. Since this is a valid exception to the rule, an eslint comment is added to the top of both to convey this.
    
    See https://eslint.org/docs/rules/class-methods-use-this#exceptions for more details
    pr1sm committed Feb 22, 2019
    Configuration menu
    Copy the full SHA
    4b07f05 View commit details
    Browse the repository at this point in the history
  7. Adjust Event Emitter Max Listeners

    This commit adjusts the max listeners for the TaskManager and TaskRunner event listeners. This allows many tasks (>25) to run without producing memory leak warnings.
    pr1sm committed Feb 22, 2019
    Configuration menu
    Copy the full SHA
    6fc99e8 View commit details
    Browse the repository at this point in the history
  8. Fix Delay and Webhook Event Passing

    This commit updates the event handlers to allow responding to a bulk event. In this case the ID passed will be 'ALL'. This allows a single event to be emitted when adjusting a delay or webhook in the TaskManager for all tasks.
    
    This also keeps the contract of purely using event based communication between the manager and runner.
    pr1sm committed Feb 22, 2019
    Configuration menu
    Copy the full SHA
    9752f4c View commit details
    Browse the repository at this point in the history
  9. Refactor Default TaskManager Implementation

    This commit updates the default single thread TaskManager Implementation to have similar syntax as the SplitContextTaskManager. This ensures all TaskManger implementations work when used.
    pr1sm committed Feb 22, 2019
    Configuration menu
    Copy the full SHA
    fe91b94 View commit details
    Browse the repository at this point in the history
  10. Switch Defaults to use SplitThreadTaskManger

    This commit updates the default task manager to use the multi thread implementation. The set env var for prod is also updated to use thread instead of process.
    pr1sm committed Feb 22, 2019
    Configuration menu
    Copy the full SHA
    7ea6ba4 View commit details
    Browse the repository at this point in the history