package com.iotize.plugin.cordova.zebrarfid;

public interface AsyncMethodCallback<ResultType, ErrorType extends Throwable> {

    /**
     * Perform background operation
     * @return data
     * @throws ErrorType
     */
    ResultType doInBackground() throws ErrorType;

    /**
     * Called when call is successful. run on UI thread
     * @param result
     */
    void onComplete(ResultType result) throws Exception;

    /**
     * Called when call throw an error. run on UI thread
     * @param error
     */
    void onError(Throwable error) throws Exception;
}
