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

io.muserver.DoneCallback Maven / Gradle / Ivy

The newest version!
package io.muserver;

/**
 * A callback for async operations that calls when an operation completes.
 */
public interface DoneCallback {

    /**
     * The operation has completed.
     *
     * @param error If null, then the operation was a success. Otherwise it failed.
     * @throws Exception The result of throwing an exception depends on the operation, and may include actions such as
     *                   disconnecting the client.
     */
    void onComplete(Throwable error) throws Exception;

    /**
     * A callback that does nothing on completion.
     */
    DoneCallback NoOp = error -> {
    };

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy