Skip to content

Support pre-commit callback - #99

Merged
mikee47 merged 7 commits into
developfrom
feature/datagen
Aug 12, 2026
Merged

Support pre-commit callback#99
mikee47 merged 7 commits into
developfrom
feature/datagen

Conversation

@mikee47

@mikee47 mikee47 commented Aug 8, 2026

Copy link
Copy Markdown
Owner

This PR provides support for registering callbacks on objects, invoked just before changes are committed. Typically this would be at the end of a streaming import.

Applications call onCommit to register a callback, which remains active indefinitely. The mechanism is similar to how asynchronous updates are handled, except those are 'one-shot' callbacks.

The callback receives an updater instance, and if clearDirty is called then the data is never flushed to the filesystem. This can be used to support 'ephemeral' or temporary in-RAM only use.

Another use for the callback is to perform extended data validation before data is written to the filesystem. The update can be rejected by calling clearDirty.

Change callbacks are discussed in issue #48. This PR is a partial solution to that but at present there is no indication as to which fields have changed.

TODO:

  • Use a single queue for asynchronous updates and the commit callbacks, and tag the items so other types of callback may be registered in the future
  • Update documentation
  • Look at memory usage in commit callback: ideally, allocated storage for streaming should be released beforehand

@mikee47
mikee47 marked this pull request as draft August 8, 2026 16:02
@mikee47 mikee47 changed the title Support temporary/ephemeral data reception Support pre-commit callback Aug 9, 2026
@mikee47
mikee47 marked this pull request as ready for review August 9, 2026 09:20
@mikee47 mikee47 mentioned this pull request Aug 9, 2026
@mikee47
mikee47 merged commit 7166463 into develop Aug 12, 2026
18 checks passed
@mikee47
mikee47 deleted the feature/datagen branch August 13, 2026 14:17
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