Skip to content

FeatureScope

Xavier F. Gouchet edited this page Sep 4, 2024 · 1 revision

interface FeatureScope

Represents a Datadog feature.

Properties

dataStore

abstract val dataStore: DataStoreHandler

Property to enable interaction with the data store.

Functions

sendEvent

abstract fun sendEvent(event: Any)

Send event to a given feature. It will be sent in a synchronous way.

Parameters
event Event to send.

unwrap

abstract fun <T : Feature> unwrap(): T

Returns the original feature.

withWriteContext

@AnyThread

abstract fun withWriteContext(forceNewBatch: Boolean = false, callback: (DatadogContext, EventBatchWriter) -> Unit)

Utility to write an event, asynchronously.

Parameters
forceNewBatch if true forces the EventBatchWriter to write in a new file and not reuse the already existing pending data persistence file. By default it is false.
callback an operation called with an up-to-date DatadogContext and an EventBatchWriter. Callback will be executed on a worker thread from I/O pool. DatadogContext will have a state created at the moment this method is called, before the thread switch for the callback invocation.
Clone this wiki locally