Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Persistent variables #3563

Merged
merged 4 commits into from
Dec 23, 2022
Merged

Persistent variables #3563

merged 4 commits into from
Dec 23, 2022

Conversation

sfmskywalker
Copy link
Member

This PR completes the persistent variables story where the engine will persist variables only if they are configured with a storage driver.

Before this PR, the entire memory register was serialized as part of the workflow instance, which is problematic for values that are supposed to have a transient lifetime (eg. streams, large data and non-serializable objects).

After this PR, none of the contents of the register is persisted. In order to persist a value, one needs to use a Variable AND configure it with a storage driver.

Currently, only two such driver types exist:

  • Memory
  • Workflow

The Memory driver stores values in a local dictionary and lives for as long as the application does.

The Workflow driver stores the variable inside of the workflow instance document itself. This means that the variable value must be serializable.

Future drivers may include Redis, Blob storage, Disk storage, etc.

@sfmskywalker sfmskywalker merged commit 2469258 into v3 Dec 23, 2022
@sfmskywalker sfmskywalker deleted the v3-persistent-variables branch December 23, 2022 15:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant