Sync Macro
A macro which content is executed by only one thread at a time |
Type | JAR |
Category | Macro |
Developed by | |
Rating | |
License | GNU Lesser General Public License 2.1 |
Table of contents
Description
A macro which content is executed by only one thread at a time.
A target use case for this macro is when an application which can be called by several persons at the same time to update some common document (for example, a button to let users register themself to some event where registering a user means adding that user reference to a field of the event page). Without a way to synchronize these document updates, users will keep overwriting the modifications made a few milliseconds before by other users.
Usage
some content which much not be executed by several threads at the same time
{{/sync}}
some content which much not be executed by several threads at the same time
{{/sync}}
Parameters definition
Name | Optional | Allowed values | Default value | Description |
---|---|---|---|---|
id | no | any | Empty | The identifier associated to the content to execute. Any sync macro with the same identifier, wherever it is located in the XWiki instance, will wait when a content associated with the same identifier is being executed but another thread. By default, the identifier is a combination of the identifier of the source containing the macro call and its index in that source (so each sync macro all in the same page have their own identifier). |
Prerequisites & Installation Instructions
We recommend using the Extension Manager to install this extension (Make sure that the text "Installable with the Extension Manager" is displayed at the top right location on this page to know if this extension can be installed with the Extension Manager).
You can also use the manual method which involves dropping the JAR file and all its dependencies into the WEB-INF/lib folder and restarting XWiki.
Dependencies
Dependencies for this extension (org.xwiki.contrib.concurrent:concurrent-macro-sync 1.0.0):