Adding a new CachingAgentID and CachingGateway implementation to unet.js. With this feature
import Gateway from unet.js will automatically import a sub-class of Gateway called CachingGateway.
CachingGateway returns a CachingAgentID instead of an AgentID for all methods that return an AgentID (for e.g. agentForService or agent)
A CachingAgentID will. by default, cache all Parameter Responses so that future get calls can return from the cache instead of calling through to the actual Agent.
The behavior of CachingAgentID can be controlled using two mechanisms; a greedy flag which enables/disables caching of all Parameters instead of just caching the Parameter being requested, and a maxage parameter which can force the get method to retrieve the Parameter value from the Agent depending on how old the cache is.
The CachingGateway can return the original AgentID (without the caching functionality) if the methods are called with a caching=false flag.
Adding a new
CachingAgentID
andCachingGateway
implementation tounet.js
. With this featureimport Gateway from unet.js
will automatically import a sub-class ofGateway
calledCachingGateway
.CachingGateway
returns aCachingAgentID
instead of anAgentID
for all methods that return anAgentID
(for e.g.agentForService
oragent
)CachingAgentID
will. by default, cache all Parameter Responses so that futureget
calls can return from the cache instead of calling through to the actual Agent.CachingAgentID
can be controlled using two mechanisms; agreedy
flag which enables/disables caching of all Parameters instead of just caching the Parameter being requested, and amaxage
parameter which can force theget
method to retrieve the Parameter value from the Agent depending on how old the cache is.CachingGateway
can return the originalAgentID
(without the caching functionality) if the methods are called with acaching=false
flag.