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

Add Hooks support for get/store pre-processing #207

Open
p-flock opened this issue Jul 31, 2020 · 1 comment · May be fixed by #209
Open

Add Hooks support for get/store pre-processing #207

p-flock opened this issue Jul 31, 2020 · 1 comment · May be fixed by #209
Assignees

Comments

@p-flock
Copy link
Member

p-flock commented Jul 31, 2020

The Hooks architecture supports passing custom functions to the jiff instance within the options object. Currently JIFFClient.get_preprocessing() and JIFFClient.store_preprocessing() are called directly. To allow developers to implement custom storage and retrieval of preprocessed values:

  • Add storePreprocessing and getPreprocessing to Hooks.prototype in https://github.com/multiparty/jiff/blob/master/lib/client/arch/hooks.js, mapping them to the existing get_preprocessing and store_preprocessing functions.
  • Change existing calls to JIFFClient.get_preprocessing() within the library to jiffClient.hooks.getPreprocessing()
  • Change existing calls to JIFFClient.store_preprocessing() within the library to jiffClient.hooks.storePreprocessing()

These changes will allow developers to define custom behavior for preprocessed values. After this, let's experiment with possible custom behavior:

  • create a demo in the demos/ directory to test the preprocessing hooks functionality
  • pass the jiffClient in the demo custom functions for 'getPreprocessing' and 'storePreprocessing' which interface with MongoDB (or w/e database you prefer)
  • test various preprocessing flows to confirm the hooks/database integration work
  • benchmark speed of calls to the default get/store preprocessing functions vs the speed of database reads/writes
  • benchmark node's memory usage with the default vs custom preprocessing storage
@p-flock p-flock self-assigned this Jul 31, 2020
@p-flock
Copy link
Member Author

p-flock commented Jul 31, 2020

get/store preprocessing are defined in https://github.com/multiparty/jiff/blob/master/lib/client/preprocessing/api.js

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: No status
Development

Successfully merging a pull request may close this issue.

2 participants