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

snapshots #17

Merged
merged 5 commits into from
Feb 23, 2024
Merged

snapshots #17

merged 5 commits into from
Feb 23, 2024

Conversation

geoffhendrey
Copy link
Contributor

Description

WIP

snapshots to local file
Try '.init -f example/backpressure-wf.yaml --options={snapshot:{}}'

  • Bug Fix
  • [x ] New Feature
  • Breaking Change
  • Refactor
  • [ x] Documentation
  • Other (please describe)

Checklist

  • I have read the contributing guidelines
  • Existing issues have been referenced (where applicable)
  • I have verified this change is not present in other open pull requests
  • Functionality is documented
  • All code style checks pass
  • New code contribution is covered by automated tests
  • All new and existing tests pass

@geoffhendrey geoffhendrey requested a review from a team as a code owner February 20, 2024 20:08
this.hasChanged = true;
this.changeListener = ()=>{this.hasChanged=true};
this.snapshotInterval = null;
//functions can be added here for all things that need to run during templateProcessor.onInitialize()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can alternatively use rateLimit() func like
https://github.com/cisco-open/stated-workflow/blob/main/src/test/StatedWorkflow.test.js#L756-L759


    const dataChangeCallback = rateLimit(async (output, theseThatChanged) => {
        counts.push(output.interceptedMessages.length);
    }, snapshotIntervalSeconds * 1000);
    this.templateProcessor.setDataChangeCallback("/", dataChangeCallback);

@geoffhendrey geoffhendrey changed the title wip. Try '.init -f example/backpressure-wf.yaml --options={snapshot:{}}' snapshots Feb 23, 2024
Geoffrey Hendrey added 2 commits February 22, 2024 22:02
@zhirafovod zhirafovod merged commit dc982e1 into main Feb 23, 2024
1 check passed
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.

2 participants