OSSL Script Library/JsonStore

Introduction
This page describes two scripts, a generator and a consumer, that demonstrate how to use the JsonStore JsonStoreRead and JsonStoreTake operations for creating a master/worker pair of scripts. Place the generator script in an object and the consumer script in another object. Touch the generator to start the process.

To see the value of the master/worker pattern, try to make multiple copies of the consumer object. Each one will read tasks created by the generator.

This functionality current only exists in OpenSimulator development code (0.7.4-dev). Please be aware that it is currently experimental and subject to change which may make older scripts fail to work or work slightly differently. You can find documentation of all the functions available and examples of their use can be found on the JsonStore Module page.

Enabling the JsonStore Module
The first thing is to enable the JsonStore module in OpenSim.ini. Add the following to enable the module:

[JsonStore] Enabled = True

The Generator Script
The generator script writes values to a shared array where consumers can pull those values. The script uses the global store (public scratch storage space) to share the identity of the Json store that it creates.

The Consumer Script
The consumer script waits for the generator to create the store and place its identity into the global store. At that point it begins to read values from the generator's store.