android - How can I send a "fire and forget" async call with Retrofit? -
i'd send async requests never return response (logging, business events, etc). supported retrofit?
use empty callback:
public final class callbacks { private static final callback<object> empty = new callback<object> { @override public void success(object value, response response) {} @override public void failure(retrofiterror error) {} } @suppresswarnings("unchecked") public static <t> callback<t> empty() { return (callback<t>) empty; } }
and in code:
apiservice.someendpoint(callbacks.empty());
Comments
Post a Comment