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

com.tvd12.ezyhttp.client.concurrent.DownloadCancellationToken Maven / Gradle / Ivy

The newest version!
package com.tvd12.ezyhttp.client.concurrent;

public class DownloadCancellationToken {

    private volatile boolean cancelled;

    public static final DownloadCancellationToken ALWAYS_RUN =
        new DownloadCancellationToken() {
            @Override
            public void cancel() {}
        };

    public void cancel() {
        synchronized (this) {
            this.cancelled = true;
        }
    }

    public boolean isCancelled() {
        synchronized (this) {
            return cancelled;
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy