-
Notifications
You must be signed in to change notification settings - Fork 91
Enable Gateway to Request Cache Asynchronously #756
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| // Bootstrap script that will enable an existing process to load in cache getter functionalities. | ||
|
|
||
| \d .getter | ||
|
|
||
| // Get cache from disk | ||
| getcachefromdisk:{[filepath] get hsym filepath} | ||
|
|
||
| // Get location of cache config and load it in. | ||
| cacheconfiglocation:.proc.getconfigfile["cacheconfig.json"]; | ||
| cacheconfig:.j.k raze read0 hsym first cacheconfiglocation; | ||
|
|
||
| loadcaches:{ | ||
|
bsofjan marked this conversation as resolved.
|
||
| cachename:"myfirstcache"; | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. cachename as a parameter? |
||
| caches:key cacheconfig`componentCaches; | ||
| cachefilepaths: ` sv' ((hsym `$cacheconfig`cacherootdir),2#`$cachename),/:`$(string caches),\:"/data"; | ||
| cachesdata:getcachefromdisk each cachefilepaths; | ||
| cachevarnames:` sv' `.anycache.cache,/:caches; | ||
| cachevarnames set' cachesdata; | ||
| } | ||
|
|
||
| requestnewcache:{[cachename; args] | ||
|
bsofjan marked this conversation as resolved.
|
||
| cachename:"myfirstcache"; | ||
| args:`cache1`cache2!(`a`b`c! 1 2 3;`d`e`f!4 5 6); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. you're overwriting the args and cachename parameters here - if you want to give examples then use comments in the same format as the rest of the TorQ codebase to show what the parameters should look like |
||
| processname:"AsyncCache"; | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. should processname be a parameter? Should the value be in lower case instead of CamelCase? |
||
| maincache:` sv (hsym `$cacheconfig`cacherootdir),(`$cachename),`$processname, "_", string .z.P; | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. related to the above - not sure what this is doing without knowing what should be inside cacheconfig |
||
| (` sv maincache,`args) set args | ||
| } | ||
|
|
||
| \d . | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what is cacheconfig expected to look like? It's probably worthwhile having a template json file so developers know what should be in the file