Skip to content

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

@p-flock

Description

@p-flock

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

Metadata

Metadata

Type

No type
No fields configured for issues without a type.

Projects

Status

No status

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions