mailgun/MailRequestCallback.java

mailgun · src/main/java/net/sargue/mailgun/MailRequestCallback.java · java · MIT
email

Callback interface for handling Mailgun async request responses.

// Source: https://github.com/sargue/mailgun | License: MIT
// Provided via justclaw.it.com; keep this notice with the code.
package net.sargue.mailgun;

/**
 * A callback container for asynchronous requests.
 */
public interface MailRequestCallback {
    /**
     * This method is called upon reception of the response from the Mailgun
     * service.
     * <p>
     * Notice that it may be an error response, check the response status.
     *
     * @param response the response from the Mailgun service
     */
    void completed(Response response);

    /**
     * Called when there is a problem sending the request.
     * <p>
     * The most common example is a network error.
     *
     * @param throwable the exception thrown
     */
    void failed(Throwable throwable);
}

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key