public Runnable generateCacheExpirer() {
        class CheckAndExpireCache implements Runnable {

            public CheckAndExpireCache() {
            }

            @Override
            public void run() {
                try {
                    storeTable.handleCacheExpiry(cacheExpiryCompiledCondition, generateDeleteEventChunk());
                } catch (Exception e) {
                    throw new SiddhiAppRuntimeException(siddhiAppContext.getName() + ": " + e.getMessage());
                }
            }
        }
        return new CheckAndExpireCache();
    }
this class has a runnable which runs on a separate thread called by AbstractQueryableRecordTable and handles cache
expiry
modules/siddhi-core/src/main/java/io/siddhi/core/util/cache/CacheExpirer.java