protected void scheduleTtl ( K key , MapEntryValue value ) { if ( value . ttl ( ) > 0 ) { value . timer = getScheduler ( ) . schedule ( Duration . ofMillis ( value . ttl ( ) ) , ( ) -> { entries ( ) . remove ( key , value ) ; publish ( new AtomicMapEvent <> ( AtomicMapEvent . Type . REMOVE , key , null , toVersioned ( value ) ) ) ; } ) ; } }
Schedules the TTL for the given value .