1
0
mirror of https://github.com/node-red/node-red.git synced 2023-10-10 13:36:53 +02:00

Updated Design: Persistable Context (markdown)

Dave Conway-Jones 2018-03-20 08:56:33 +00:00
parent 6a57a29281
commit dcb6b971e5

@ -105,6 +105,7 @@ The value set in the config is passed to the plugin. These items are defined by
>>>> 3. Store the context variable in memory, and notify a user of the undefined module name. >>>> 3. Store the context variable in memory, and notify a user of the undefined module name.
>>>> >>>>
>>>> I listed the actual cases below. The above handling is related to the case 3. >>>> I listed the actual cases below. The above handling is related to the case 3.
>>> DCJ: And if entire contextStorage section missing (as-in an upgrade where user hasn't edited settings.js) then use memory.
- There are three different scenarios when importing a flow that uses context storage. - There are three different scenarios when importing a flow that uses context storage.
1. A user wants to run the flow as is by settings a context storage appropriately. 1. A user wants to run the flow as is by settings a context storage appropriately.
@ -114,7 +115,9 @@ The value set in the config is passed to the plugin. These items are defined by
- To support all of the above cases, when the imported flow contains a persistable context: - To support all of the above cases, when the imported flow contains a persistable context:
1. if the identifier is defined, use the context storage. 1. if the identifier is defined, use the context storage.
1. if the identifier is not defined but `default` identifier is defined, use the default context storage. 1. if the identifier is not defined but `default` identifier is defined, use the default context storage.
> DCJ: In this case - what happens if the default doesn't support a feature (like 'run(...') ? We should warn at least if not exact match.
1. if neither the identifier nor a `default` identifier are not defined, throw an exception. 1. if neither the identifier nor a `default` identifier are not defined, throw an exception.
> DCJ: Yes not running but ideally still able to edit/correct the error if possible.
## Executing plugin specific function ## Executing plugin specific function
Currently, `get` / `set` / `keys` is only methods to handle Context. Currently, `get` / `set` / `keys` is only methods to handle Context.