retrofit / retrofit2 / SkipCallbackExecutor

SkipCallbackExecutor

@Target([AnnotationTarget.FUNCTION, AnnotationTarget.PROPERTY_GETTER, AnnotationTarget.PROPERTY_SETTER]) class SkipCallbackExecutor

Change the behavior of a Call<BodyType> return type to not use the for invoking the onResponse or onFailure methods.


  @SkipCallbackExecutor
  @GET("user/{id}/token")
  Call<String> getToken(@Path("id") long id);
  
This annotation can also be used when a CallAdapter.Factory explicitly delegates to the built-in factory for Call via Retrofit#nextCallAdapter(CallAdapter.Factory, * Type, Annotation[]) in order for the returned Call to skip the executor. (Note: by default, a Call supplied directly to a CallAdapter will already skip the callback executor. The annotation is only useful when looking up the built-in adapter.)

Constructors

<init>

SkipCallbackExecutor()

Change the behavior of a Call<BodyType> return type to not use the for invoking the onResponse or onFailure methods.


  @SkipCallbackExecutor
  @GET("user/{id}/token")
  Call<String> getToken(@Path("id") long id);
  
This annotation can also be used when a CallAdapter.Factory explicitly delegates to the built-in factory for Call via Retrofit#nextCallAdapter(CallAdapter.Factory, * Type, Annotation[]) in order for the returned Call to skip the executor. (Note: by default, a Call supplied directly to a CallAdapter will already skip the callback executor. The annotation is only useful when looking up the built-in adapter.)