Interface AsyncOperationEndStrategy
- All Known Implementing Classes:
Jdk8AsyncOperationEndStrategy
public interface AsyncOperationEndStrategy
Implementations of this interface describe how to compose over supported asynchronous computation types and delay marking the operation as ended by calling
Instrumenter.end(Context, Object, Object, Throwable).-
Method Summary
Modifier and TypeMethodDescription<REQUEST,RESPONSE>
Objectend(io.opentelemetry.instrumentation.api.instrumenter.Instrumenter<REQUEST, RESPONSE> instrumenter, io.opentelemetry.context.Context context, REQUEST request, Object asyncValue, Class<RESPONSE> responseType) Composes overasyncValueand delays theInstrumenter.end(Context, Object, Object, Throwable)call until after the asynchronous operation represented byasyncValuecompletes.booleanReturns true for every asynchronous computation typeasyncTypethis strategy supports.
-
Method Details
-
supports
Returns true for every asynchronous computation typeasyncTypethis strategy supports. -
end
<REQUEST,RESPONSE> Object end(io.opentelemetry.instrumentation.api.instrumenter.Instrumenter<REQUEST, RESPONSE> instrumenter, io.opentelemetry.context.Context context, REQUEST request, Object asyncValue, Class<RESPONSE> responseType) Composes overasyncValueand delays theInstrumenter.end(Context, Object, Object, Throwable)call until after the asynchronous operation represented byasyncValuecompletes.- Parameters:
instrumenter- TheInstrumenterto be used to end the operation stored in thecontext.asyncValue- Return value from the instrumented method. Must be an instance of aasyncTypefor whichsupports(Class)returned true (in particular it must not benull).responseType- Expected type of the response that should be obtained from theasyncValue. If the result of the async computation is instance of the passed type it will be passed when theinstrumenteris called.- Returns:
- Either
asyncValueor a value composing overasyncValuefor notification of completion.
-