cleanupJob

abstract fun cleanupJob(interval: Duration): CleanupJob

Returns a CleanupJob that, when started, periodically scans the store and removes entries whose TTL has elapsed.

The job runs on the background dispatcher and sweeps at the given interval. Cancel the returned CleanupJob (or its parent scope) to stop sweeping.

Return

A CleanupJob ready to be started.

Parameters

interval

How often the cleanup sweep runs. Must be positive.

See also