Skip to main content

Engines

In the framework-core library, an Engine is a vital component tasked with orchestrating the execution of plugins. It operates based on a tool-config, which outlines a specific sequence of plugins and groups for execution.

The Engine is responsible for managing the execution flow, handling errors, and facilitating event callbacks, collectively ensuring a robust and efficient system for plugin operations within the framework.

During the initialization phase of the Engine, the Registry is introduced to manage registered plugins. The framework-common-extensions supply a set of default plugins, while the system remains open to the registration of additional plugins as necessary.

Engine execution​

The BaseEngine class introduces the execute_engine method. Key functionalities include:

  • Accepting an engine portion of a tool-config and user options as parameters.
  • Iterating through the tool-config to execute each plugin or group of plugins as defined passing the store and options along.

The default store is a simple dictionary that plugins can use to store and retrieve data. The store is passed to each plugin during execution, allowing for data to be shared between plugins. The format/structure of the store is defined by the user and can be modified as needed.

Plugin execution​

In addition to engine execution, the BaseEngine class facilitates individual plugin execution through the run_plugin method. This method's responsibilities encompass:

  • Initialization of the plugin with specified options.
  • Execution of the plugin's run method, incorporating the plugin store as a parameter.

See plugin execution details for more info.