TiddlyWiki.org

Ticket #54 (closed enhancement: fixed)

Opened 2 years ago

Last modified 1 year ago

Provide a means to control the execution order between interdependent plugins

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

Description (Last modified by JeremyRuston)

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 (2.2 kB) - added by UdoBorkowski on 05/03/07 11:53:05.
Patch to fix this ticket, using the "Requires" slice approach

Change History

10/07/06 14:33:11 changed by JeremyRuston

  • status changed from new to assigned.

06/10/06 14:34:50 changed 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 changed.
  • milestone changed from 2.1 to unscheduled.

01/01/07 10:10:26 changed by UdoBorkowski

This ticket was also subject in this discussion

01/01/07 23:26:12 changed by UdoBorkowski

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

01/01/07 23:26:38 changed by UdoBorkowski

  • milestone changed from unscheduled to 2.2.

05/03/07 11:53:05 changed by UdoBorkowski

  • attachment ticket54.patch added.

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

05/03/07 11:53:47 changed 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");

28/03/07 14:20:34 changed by JeremyRuston

  • status changed from assigned to closed.
  • resolution set to fixed.