All Downloads are FREE. Search and download functionalities are using the official Maven repository.

Alachisoft.NCache.Common.yield.YieldAdapterIterator Maven / Gradle / Ivy

There is a newer version: 5.3.3
Show newest version
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Alachisoft.NCache.Common.yield;


import java.util.Iterator;

/**
 * A version of a standard Iterator<> used by the yield adapter. The only addition is a dispose()
 * function to clear resources manually when required.
 */
public interface YieldAdapterIterator extends Iterator {

    /**
     * Because the Yield Adapter starts a separate thread for duration of the collection, this can
     * be left open if the calling code only reads part of the collection. If the iterator goes out
     * of scope, when it is GCed its finalize() will close the collection thread. However garbage
     * collection is sporadic and the VM will not trigger it simply because there is a lack of
     * available threads. So, if a lot of partial reads are happening, it will be wise to manually
     * close the iterator (which will clear the resources immediately).
     */
    void dispose();
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy