-
public interface FeatureScopeRepresents a Datadog feature.
-
-
Method Summary
Modifier and Type Method Description abstract UnitwithWriteContext(Set<String> withFeatureContexts, Function2<DatadogContext, Function1<Function1<EventBatchWriter, Unit>, Unit>, Unit> callback)Utility to write an event, asynchronously. abstract UnitwithContext(Set<String> withFeatureContexts, Function1<DatadogContext, Unit> callback)Utility to read current DatadogContext, asynchronously. abstract BooleanwithWriteContextSync(Set<String> withFeatureContexts, Function2<DatadogContext, Function1<Function1<EventBatchWriter, Unit>, Unit>, Unit> callback)Same as withWriteContext, but blocks the calling thread until callback has returned. abstract UnitsendEvent(Object event)Send event to a given feature. abstract <T extends Feature> Tunwrap()Returns the original feature. abstract DataStoreHandlergetDataStore()Property to enable interaction with the data store. -
-
Method Detail
-
withWriteContext
@AnyThread() abstract Unit withWriteContext(Set<String> withFeatureContexts, Function2<DatadogContext, Function1<Function1<EventBatchWriter, Unit>, Unit>, Unit> callback)
Utility to write an event, asynchronously.
- Parameters:
withFeatureContexts- Feature contexts (DatadogContext.featuresContext property) to include in the DatadogContext provided.callback- an operation called with an up-to-date DatadogContext and an EventWriteScope.
-
withContext
@AnyThread() abstract Unit withContext(Set<String> withFeatureContexts, Function1<DatadogContext, Unit> callback)
Utility to read current DatadogContext, asynchronously.
- Parameters:
withFeatureContexts- Feature contexts (DatadogContext.featuresContext property) to include in the DatadogContext provided.callback- an operation called with an up-to-date DatadogContext.
-
withWriteContextSync
@AnyThread() abstract Boolean withWriteContextSync(Set<String> withFeatureContexts, Function2<DatadogContext, Function1<Function1<EventBatchWriter, Unit>, Unit>, Unit> callback)
Same as withWriteContext, but blocks the calling thread until callback has returned.
The callback still runs on the context processing worker thread, so the calling thread must not hold any lock that callback may need, otherwise the two will deadlock.
- Parameters:
withFeatureContexts- Feature contexts (DatadogContext.featuresContext property) to include in the DatadogContext provided.callback- an operation called with an up-to-date DatadogContext and an EventWriteScope.
-
sendEvent
abstract Unit sendEvent(Object event)
Send event to a given feature. It will be sent in a synchronous way.
- Parameters:
event- Event to send.
-
getDataStore
abstract DataStoreHandler getDataStore()
Property to enable interaction with the data store.
-
-
-
-