Ticket #54 (closed enhancement: fixed)

Opened 7 years ago

Last modified 6 years ago

Provide a means to control the execution order between interdependent plugins

Reported by: JeremyRuston Owned by: UdoBorkowski
Priority: minor Milestone: 2.2
Component: core Version:
Severity: low Keywords:
Cc:

Description (last modified by JeremyRuston) (diff)

One approach is for systemConfig tiddlers to return a value. It is proposed that this value be interpreted as a hashmap of output parameters:

  • callMeBack: set to true to have the systemConfig tiddler be reexecuted again at the end of the currently scheduled tiddlers. This is designed to allow systemConfig tiddlers to 'bail out' if they can't executed until some dependent systemConfig tiddler has executed. This feature needs to be coded carefully to avoid deadlocks and endless loops

For example, return {callMeBack: true};

Attachments

ticket54.patch Download (2.2 KB) - added by UdoBorkowski 6 years ago.
Patch to fix this ticket, using the "Requires" slice approach

Change History

Changed 7 years ago by JeremyRuston

  • status changed from new to assigned

Changed 7 years ago by JeremyRuston

  • summary changed from Make standard parameters available to systemConfig code to Provide a means to control the execution order between interdependent plugins
  • description modified (diff)
  • milestone changed from 2.1 to unscheduled

Changed 6 years ago by UdoBorkowski

This ticket was also subject in  this discussion

Changed 6 years ago by UdoBorkowski

  • owner changed from JeremyRuston to UdoBorkowski
  • status changed from assigned to new

Changed 6 years ago by UdoBorkowski

  • milestone changed from unscheduled to 2.2

Changed 6 years ago by UdoBorkowski

Patch to fix this ticket, using the "Requires" slice approach

Changed 6 years ago by UdoBorkowski

  • status changed from new to assigned

A different approach than originally suggested is used, refering to an explicit list of plugins specified in the "Requires" slice of the plugin.

A patch is attached.

Here a brief description:

By default plugins are loaded in the order they are stored in the TiddlyWiki. You may change this plugin load order through the "Requires" slice of the plugin tiddler. This slice lists all plugins to be loaded before "this" plugin is loaded. The Requires slice is typically given in the header part of the plugin tiddler. E.g.

/***
|''Name:''|PluginD|
|''Source:''|http://example.com/#PluginD|
|''Requires:''|http://example.com/#PluginC PluginE|
***/

The plugins may be specified by their Name or their Source, in the same syntax as tags are specified in the Tags list ("BracketedList?").

Loading plugins using the Requires slice is done on a "best attempt" base. I.e. no errors will be reported e.g. if a plugin specified does not exists or cyclics are defined. If a plugin really needs a certain plugin it must explicitly check this, e.g. with code like this at the beginning of the plugin:

if (!version.extensions.ForEachTiddlerPlugin || version.extensions.ForEachTiddlerPlugin.version < 2)
    throw new Error("Requires ForEachTiddlerPlugin Version 2.0 or better");

Changed 6 years ago by JeremyRuston

  • status changed from assigned to closed
  • resolution set to fixed
Note: See TracTickets for help on using tickets.