As a developer, applications I develop may make multiple requests against same RemoteCallable using the same parameter(s) many times. In such circumstances, and where an appropriate for an application, it would be beneficial if the results of the RemoteCallable could be cached locally to improve performance.
To support this capability we could introduce the concept of a Caching option for a RemoteChannel, including:
Caching.enabled(Option... options) - indicating the result must be cached for the RemoteCallable.
With Options for specifying the duration of the caching and the "identity" of the context in which to perform the caching.
Multiple requests to invoke the same RemoteCallable when Caching is enabled will return the cached result (if still valid)
Result r = application.invoke(callable, Caching.enabled());
Caching.disabled() - indicating any previous result should be ignored (the default)
Importantly, for the results of RemoteCallables to be cached, RemoteCallables must correctly implement hashcode and equals.
As a developer, applications I develop may make multiple requests against same RemoteCallable using the same parameter(s) many times. In such circumstances, and where an appropriate for an application, it would be beneficial if the results of the RemoteCallable could be cached locally to improve performance.
To support this capability we could introduce the concept of a Caching option for a RemoteChannel, including:
With Options for specifying the duration of the caching and the "identity" of the context in which to perform the caching.
Multiple requests to invoke the same RemoteCallable when Caching is enabled will return the cached result (if still valid)
Importantly, for the results of RemoteCallables to be cached, RemoteCallables must correctly implement hashcode and equals.