public class MetricSendingQueueConsumer
extends java.lang.Object
| Constructor and Description |
|---|
MetricSendingQueueConsumer(MetricSendingQueue queue,
PubSdkApi api,
BuildConfigWrapper buildConfigWrapper,
Config config,
java.util.concurrent.Executor executor) |
| Modifier and Type | Method and Description |
|---|---|
void |
sendMetricBatch()
Send asynchronously a new batch of metrics to the CSM backend.
|
public MetricSendingQueueConsumer(@NonNull
MetricSendingQueue queue,
@NonNull
PubSdkApi api,
@NonNull
BuildConfigWrapper buildConfigWrapper,
@NonNull
Config config,
@NonNull
java.util.concurrent.Executor executor)
public void sendMetricBatch()
This is a fire and forget operation. No output is expected. Although, if an error occurs while sending the metrics to the backend, they are pushed back in the sending queue.
The batch is polled from the queue (instead of peeked). Data loss is tolerated if the process is terminated while the batch is being sent to the CSM backed. This is to ensure that the same metric will never be sent to CSM backend twice.