DataQueue Service

Overview

The DataQueue Service provides access to thread-safe FIFO queues. This service is particularly useful when used in conjunction with a PersistentHitQueue.

Usage

The following code snippet shows how to create a DataQueue and add a DataEntity to the queue.
Android
iOS(AEP 3.x)
1
import com.adobe.marketing.mobile.services.*;
2
3
DataQueue dataQueue = ServiceProvider.getInstance().getDataQueueService().getDataQueue(name);
4
DataEntity dataEntity = new DataEntity(mydata);
5
dataQueue.add(dataEntity);
Copied!
1
import AEPServices
2
3
// Create a `DataQueue`
4
guard let dataQueue = ServiceProvider.shared.dataQueueService.getDataQueue(label: name) else {
5
Log.error(label: "\(name):\(#function)", "Failed to create Data Queue")
6
return
7
}
8
9
// Create a `DataEntity`
10
let entity = DataEntity(data: myData)
11
12
// Add entity to `dataQueue`
13
dataQueue.add(entity)
Copied!
Last modified 3mo ago
Export as PDF
Copy link
Edit on GitHub