pgator

Caching system

License
Subject to the terms of the MIT license, as written in the included LICENSE file.
Authors
Zaramzan

class  Cache;

Represent caching system

Authors
Zaramzan

shared this(shared SqlJsonTable table);

Construct caching system

Parameters
SqlJsonTable table describes methods and caching rules

shared bool  reset(RpcRequest req);

Drop cache by request


shared bool  reset(string method);

Drop all method cache


shared void  add(in RpcRequest req, shared RpcResponse res);

Add cache by request


shared bool  get(in RpcRequest req, out RpcResponse res);

Search cache by request in memory.

Parameters
RpcRequest req RPC request
RpcResponse res if cache found in memory, res will be assigned
Returns
true, if found in memory, otherwise returns false