docs updated

pull/6244/head
Nikita Koksharov 3 months ago
parent 42faaf8f08
commit 8cb9a373f8

@ -498,15 +498,19 @@ Below is the complete list of available managers:
// NONE - No synchronizations on map changes // NONE - No synchronizations on map changes
.syncStrategy(SyncStrategy.INVALIDATE) .syncStrategy(SyncStrategy.INVALIDATE)
// time to live for each map entry in local cache // time to live for each entry in local cache
.timeToLive(10000) .timeToLive(Duration.ofSeconds(10))
// or
.timeToLive(10, TimeUnit.SECONDS) // max idle time for each entry in local cache
.maxIdle(Duration.ofSeconds(10));
// max idle time for each map entry in local cache
.maxIdle(10000) // Defines how to listen expired event sent by Redis or Valkey upon this instance deletion
// or //
.maxIdle(10, TimeUnit.SECONDS); // Follow expiration policies are available:
// DONT_SUBSCRIBE - Don't subscribe on expire event
// SUBSCRIBE_WITH_KEYEVENT_PATTERN - Subscribe on expire event using `__keyevent@*:expired` pattern
// SUBSCRIBE_WITH_KEYSPACE_CHANNEL - Subscribe on expire event using `__keyspace@N__:name` channel
.expirationEventPolicy(ExpirationEventPolicy.SUBSCRIBE_WITH_KEYEVENT_PATTERN)
``` ```
Usage example: Usage example:
@ -614,15 +618,19 @@ Cache<String, String> cache = manager.createCache("namedCache", rConfig);
// NONE - No synchronizations on map changes // NONE - No synchronizations on map changes
.syncStrategy(SyncStrategy.INVALIDATE) .syncStrategy(SyncStrategy.INVALIDATE)
// time to live for each map entry in local cache // time to live for each entry in local cache
.timeToLive(10000) .timeToLive(Duration.ofSeconds(10))
// or
.timeToLive(10, TimeUnit.SECONDS)
// max idle time for each map entry in local cache // max idle time for each entry in local cache
.maxIdle(10000) .maxIdle(Duration.ofSeconds(10));
// or
.maxIdle(10, TimeUnit.SECONDS); // Defines how to listen expired event sent by Redis or Valkey upon this instance deletion
//
// Follow expiration policies are available:
// DONT_SUBSCRIBE - Don't subscribe on expire event
// SUBSCRIBE_WITH_KEYEVENT_PATTERN - Subscribe on expire event using `__keyevent@*:expired` pattern
// SUBSCRIBE_WITH_KEYSPACE_CHANNEL - Subscribe on expire event using `__keyspace@N__:name` channel
.expirationEventPolicy(ExpirationEventPolicy.SUBSCRIBE_WITH_KEYEVENT_PATTERN)
``` ```
Usage examples: Usage examples:

@ -151,15 +151,20 @@ LocalCachedMapOptions options = LocalCachedMapOptions.defaults()
// NONE - No synchronizations on map changes // NONE - No synchronizations on map changes
.syncStrategy(SyncStrategy.INVALIDATE) .syncStrategy(SyncStrategy.INVALIDATE)
// time to live for each map entry in local cache // time to live for each entry in local cache
.timeToLive(10000) .timeToLive(Duration.ofSeconds(10))
// or
.timeToLive(10, TimeUnit.SECONDS) // max idle time for each entry in local cache
.maxIdle(Duration.ofSeconds(10));
// max idle time for each map entry in local cache
.maxIdle(10000) // Defines how to listen expired event sent by Redis or Valkey upon this instance deletion
// or //
.maxIdle(10, TimeUnit.SECONDS); // Follow expiration policies are available:
// DONT_SUBSCRIBE - Don't subscribe on expire event
// SUBSCRIBE_WITH_KEYEVENT_PATTERN - Subscribe on expire event using `__keyevent@*:expired` pattern
// SUBSCRIBE_WITH_KEYSPACE_CHANNEL - Subscribe on expire event using `__keyspace@N__:name` channel
.expirationEventPolicy(ExpirationEventPolicy.SUBSCRIBE_WITH_KEYEVENT_PATTERN)
``` ```
Each Spring Cache instance has two important parameters: `ttl` and `maxIdleTime` and stores data infinitely if they are not defined or equal to `0`. Each Spring Cache instance has two important parameters: `ttl` and `maxIdleTime` and stores data infinitely if they are not defined or equal to `0`.

@ -212,15 +212,19 @@ Follow options can be supplied during object creation:
// NONE - No synchronizations on map changes // NONE - No synchronizations on map changes
.syncStrategy(SyncStrategy.INVALIDATE) .syncStrategy(SyncStrategy.INVALIDATE)
// time to live for each map entry in local cache // time to live for each entry in local cache
.timeToLive(10000) .timeToLive(Duration.ofSeconds(10))
// or
.timeToLive(10, TimeUnit.SECONDS)
// max idle time for each map entry in local cache // max idle time for each map entry in local cache
.maxIdle(10000) .maxIdle(Duration.ofSeconds(10))
// or
.maxIdle(10, TimeUnit.SECONDS); // Defines how to listen expired event sent by Redis or Valkey upon this instance deletion
//
// Follow expiration policies are available:
// DONT_SUBSCRIBE - Don't subscribe on expire event
// SUBSCRIBE_WITH_KEYEVENT_PATTERN - Subscribe on expire event using `__keyevent@*:expired` pattern
// SUBSCRIBE_WITH_KEYSPACE_CHANNEL - Subscribe on expire event using `__keyspace@N__:name` channel
.expirationEventPolicy(ExpirationEventPolicy.SUBSCRIBE_WITH_KEYEVENT_PATTERN);
``` ```
Code example: Code example:
@ -836,8 +840,8 @@ Follow options can be supplied during object creation:
// //
// Follow expiration policies are available: // Follow expiration policies are available:
// DONT_SUBSCRIBE - Don't subscribe on expire event // DONT_SUBSCRIBE - Don't subscribe on expire event
// SUBSCRIBE_WITH_KEYEVENT_PATTERN - Subscribe on expire event using __keyevent@*:expired pattern // SUBSCRIBE_WITH_KEYEVENT_PATTERN - Subscribe on expire event using `__keyevent@*:expired` pattern
// SUBSCRIBE_WITH_KEYSPACE_CHANNEL - Subscribe on expire event using __keyspace@N__:name channel // SUBSCRIBE_WITH_KEYSPACE_CHANNEL - Subscribe on expire event using `__keyspace@N__:name` channel
.expirationEventPolicy(ExpirationEventPolicy.SUBSCRIBE_WITH_KEYEVENT_PATTERN) .expirationEventPolicy(ExpirationEventPolicy.SUBSCRIBE_WITH_KEYEVENT_PATTERN)
``` ```

Loading…
Cancel
Save