Package dagger.producers
Annotation Type CancellationPolicy
-
@Documented @Target(TYPE) @Retention(CLASS) @Beta public @interface CancellationPolicyAnnotates a production component or subcomponent to specify its policy when a child component is cancelled.When a future returned from an entry point on a production component is cancelled, the component is cancelled: all producers in the component (including those for other entry points) are cancelled.
When a child component is cancelled, its parent component is not cancelled unless the parent component is annotated with
@CancellationPolicy(fromSubcomponents = PROPAGATE). If that parent component has a parent (the grandparent of the cancelled child component), it will not be cancelled unless it also has a@CancellationPolicyannotation allowing cancellation to propagate to it from subcomponents.
-
-
Required Element Summary
Required Elements Modifier and Type Required Element Description CancellationPolicy.PropagationfromSubcomponentsDefines whether the annotated production component is cancelled when a child component is cancelled.
-
-
-
Element Detail
-
fromSubcomponents
CancellationPolicy.Propagation fromSubcomponents
Defines whether the annotated production component is cancelled when a child component is cancelled.The default, if no cancellation policy annotation is provided, is
CancellationPolicy.Propagation.IGNORE.
-
-