Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions code/common/getter.q
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}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

filePath -> file path


// Get location of cache config and load it in.
cacheconfiglocation:.proc.getconfigfile["cacheconfig.json"];
cacheconfig:.j.k raze read0 hsym first cacheconfiglocation;

loadcaches:{

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix the camelCase in this function

cachename:"MyFirstCache";
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]

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

camelCase here too

cachename:"MyFirstCache";
args:`cache1`cache2!(`a`b`c! 1 2 3;`d`e`f!4 5 6);
processname:"AsyncCache";
maincache:` sv (hsym `$cacheconfig`cacheRootDir),(`$cachename),`$processname, "_", string .z.P;
(` sv maincache,`args) set args
}

\d .