Add cacheConfig, setter process, getter script#743
Conversation
|
A few general things you need to do when committing to TorQ:
|
|
I have reviewed the TorQ codebase and could not find an existing utility function for the setter.q and getter.q functions. There are existing save and load utilities in the TorQ codebase, however they are highly specific (e.g. loading q and k scripts, saving partitions) and not suitable for use for saving and loading with the anymap data format. I have also addressed all the other points through my latest commit "Standardising Changes and Add Default json" and by adding more detailed description to the PR. |
|
@bsofjan thanks for checking if the utility was present in TorQ and for addressing my other comments - looks good to merge |
|
@CJA18 Thank you - I think it is best to wait prior to merging as the PRs functions as checkpoints of work, and merging can be considered once the whole project comes around. |
| \d .getter | ||
|
|
||
| // Get cache from disk | ||
| getcachefromdisk:{[filePath] load hsym filePath} |
There was a problem hiding this comment.
filePath -> filepath
this also seems like a very thin wrapper around load, is it really useful to have this?
| \d .setter | ||
|
|
||
| // Save cache down to disk | ||
| savecachedowntodisk:{[data;filePath] (hsym filePath) set data }; |
There was a problem hiding this comment.
filePath -> filepath
and similar to the getter function, very thin wrapper around set, is it useful?
|
|
||
| // Get location of cache config and load it in. | ||
| cacheconfiglocation:.proc.getconfigfile["cacheconfig.json"]; | ||
| cacheconfig:.j.k raze read0 hsym first cacheconfiglocation; |
There was a problem hiding this comment.
I think .proc.getconfigfile should only return one file, do we need the first here?
| @@ -0,0 +1,12 @@ | |||
| // Setter process to set cache to disk | |||
|
|
|||
| \d .setter | |||
There was a problem hiding this comment.
I think this namespace is unclear, without having additional context it isn't apparent what "setter" is or is for
| @@ -0,0 +1,12 @@ | |||
| // Setter process to set cache to disk | |||
There was a problem hiding this comment.
should this be a standalone process? seems like caching would be something that multiple processes would do so perhaps this should be a lib rather than a process?
Per Phase 1.3 Setter Process and Phase 1.4 Getter Bootstrap of the Anycache Project Proposal, in this PR I am adding:
The goal of Phase 1.3 and Phase 1.4 is to put together the bare bones of a "setter" process and "getter" functionality.