Open
Description
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
andgetPreprocessing
toHooks.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 tojiffClient.hooks.getPreprocessing()
- Change existing calls to
JIFFClient.store_preprocessing()
within the library tojiffClient.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