public static interface

FrescoInstrumenter.Instrumenter

com.facebook.imagepipeline.instrumentation.FrescoInstrumenter.Instrumenter

Class Overview

Allows to capture unit of works across different threads.

Summary

Public Methods
abstract Runnable decorateRunnable(Runnable runnable, String tag)
Called when a unit of work is about to be scheduled.
abstract boolean isTracing()
Allows to know in advance if the custom instrumenter desires to receive continuation updates.
abstract void markFailure(Object token, Throwable th)
Reports a failure while executing work.
abstract Object onBeforeSubmitWork(String tag)
Called before scheduling a new unit work.
abstract Object onBeginWork(Object token, String tag)
Captures the beginning of the continuation for stolen work.
abstract void onEndWork(Object token)
Captures the end of the continuation for stolen work.

Public Methods

public abstract Runnable decorateRunnable (Runnable runnable, String tag)

Called when a unit of work is about to be scheduled.

Parameters
runnable that will be executed.
tag name.
Returns
  • the wrapped input runnable or just the input one.

public abstract boolean isTracing ()

Allows to know in advance if the custom instrumenter desires to receive continuation updates. This can be used to avoid un-necessary work if the subscriber will not use the information provided.

Returns
  • true to specify interest in handling the updates, false otherwise.

public abstract void markFailure (Object token, Throwable th)

Reports a failure while executing work.

onEndWork(Object) still needs to be invoked.

Parameters
token returned by onBeginWork(Object, String).
th containing the failure.

public abstract Object onBeforeSubmitWork (String tag)

Called before scheduling a new unit work.

Parameters
tag name.
Returns
  • a token object that allows to track work units.

public abstract Object onBeginWork (Object token, String tag)

Captures the beginning of the continuation for stolen work.

Parameters
token returned by onBeforeSubmitWork(String).
tag optional name.

public abstract void onEndWork (Object token)

Captures the end of the continuation for stolen work.

Parameters
token returned by onBeginWork(Object, String).