suparnatural-cache / com.suparnatural.core.cache / DiskStore / blocking

blocking

val blocking: Boolean

Overrides CacheStore.blocking

Marker whether the store does any blocking I/O. If it is set to true, then it is expected that the calling thread will be blocked. Otherwise, certain method calls on the CacheStore will return immediately and all the operations will be scheduled on a separate worker thread.

Note: If blocking is set to false, then the store does not guarantee that the objects will be persisted immediately. For example, if the application terminates, some tasks scheduled on the worker may not finish and therefore, some objects may not be persisted.

If guaranteed persistence is desired, this flag should be set to true. For maximum performance, this can be set to false.