-
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 Pair<DatadogContext, Function1<Function1<EventBatchWriter, Unit>, Unit>>getWriteContextSync(Set<String> withFeatureContexts)Same as withWriteContext but will be executed in the blocking manner. 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.
-
getWriteContextSync
@AnyThread() abstract Pair<DatadogContext, Function1<Function1<EventBatchWriter, Unit>, Unit>> getWriteContextSync(Set<String> withFeatureContexts)
Same as withWriteContext but will be executed in the blocking manner.
- Parameters:
withFeatureContexts- Feature contexts (DatadogContext.featuresContext property) to include in the DatadogContext provided.
-
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.
-
-
-
-