-
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,28 @@ | ||
| // 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"]; | ||
|
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. This should probably be a function of some sort - takes a config filename, if empty load the default |
||
| cacheconfig:.j.k raze read0 hsym first cacheconfiglocation; | ||
|
bsofjan marked this conversation as resolved.
|
||
| cachename: cacheconfig`cachename; | ||
| asyncprocessname: cacheconfig`asyncprocessname; | ||
|
|
||
| loadcaches:{ | ||
|
bsofjan marked this conversation as resolved.
|
||
| 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; | ||
| } | ||
|
|
||
| // Example of args: `cache1`cache2!(`a`b`c! 1 2 3;`d`e`f!4 5 6) | ||
| requestnewcache:{[args] | ||
| maincache:` sv (hsym `$cacheconfig`cacherootdir),(`$cachename),`$asyncprocessname, "_", string .z.P; | ||
| (` sv maincache,`args) set args | ||
| } | ||
|
|
||
| \d . | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| { | ||
| "cacherootdir": "opt/anycache", | ||
| "cachename": "MyFirstCache", | ||
| "asyncprocessname": "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. CamelCase - check other config files in TorQ, if they use CamelCase it's okay but if not then change to match the convention |
||
| "componentcaches":{ | ||
| "cache1": { | ||
| "analytic": "analytic1", | ||
| "dataSource": "connection1" | ||
| }, | ||
| "cache2": { | ||
| "analytic": "analytic2", | ||
| "dataSource": "connection2" | ||
| } | ||
| }, | ||
| "getter":{ | ||
| "interval": "0D00:05" | ||
| }, | ||
| "setter":{ | ||
| "mode": "timer", | ||
| "interval": "0D00:30", | ||
| "compression": "16 3 0" | ||
| } | ||
| } | ||
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.
should this be .anycache.getter?