bakape / recache Goto Github PK
View Code? Open in Web Editor NEWrecursive compressed caching library
License: MIT License
recursive compressed caching library
License: MIT License
time.Sleep()
for 500 ms on data generation to simulate DB queriestime.Sleep()
for 50 msThey might not, if an eviction and fetch happened while a record is populating.
recordReference
is not in the cache on query, schedule it to be fetched in a separate goroutine to not block retrieving any subsequent components.Await() error
method to component interface, that blocks until a component is retrieved.
recordReference
retrieval.Having a separate Await()
method instead of returning errors on read allows for error to be propagated before the first write to destination.
Most records should have 1-3 components and thus not using arrays can prevent extra indirection. At the end of the struct can be an extension slice for records with more components.
Probably as a setter method. Default to default compression strength.
void*
to allow casting between language-idiomatic error typesHash
as a Frontend
Key
struct RecacheBufferKey
{
size_t size;
uint8_t *data;
};
encoding/gob
To establish a parenthood relationship between records, but not include it in the output. That is, the child transforms the parent and outputs the result.
Read config.json
file on boot to configure the caches and frontends without requiring any Go programming.
Something like
[
{
"limits": {
"memory": "100M",
"last_used": "1m30s"
},
"frontends": [
"endpoint": {
"url": "/:company/:brand", // Join with delimiter and use that as a key
"headers": {
"Content-Type": "application/html"
}
}
"source": {
"url": "http://localhost:8000/my-data-source",
"headers": {
"Authorization": "Bearer d4ea54de3a54d1d5ea1de"
}
}
]
}
]
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.