Skip to content

Using concurrent calls to the cache or origin

Esta Nagy edited this page Jan 24, 2021 · 1 revision

Since v1.1.0, Cache-Only allows us to use the async variants of PartialCacheSupport and BatchServiceCaller.

These are augmenting their sync counterparts using the methods of ConcurrentOperationSupport which allow you to define the timeout you wish to use and the ForkJoinPool that will allow convenient parallel calls to the cache or origin.

It is strongly recommended to use sensible timeouts and pool configuration as a wrong settings can cause bottlenecks.

After setting up these, the only additional step you need to take is to create your template from the ConcurrentCacheServiceTemplate class instead of the default implementation.

You can find a complete example in the Parcel tracker example.