org.mwg.Callback Maven / Gradle / Ivy
The newest version!
package org.mwg;
/**
* Generic structure to define tasks to be executed when an asynchronous result is released.
* In Java 8, Typescript and JavaScript, this structure can be replaced by a closure.
*
* @param The type of the expected result.
*/
@FunctionalInterface
public interface Callback {
/**
* This method is called when an asynchronous result is delivered.
*
* @param result The expected result.
*/
void on(A result);
}