deliverFiles static method
Future<ChartExportDeliveryBatchResult>
deliverFiles(
- Iterable<
ChartExportFile> files, - ChartExportDeliveryAdapter adapter, {
- Duration? timeout,
- ChartExportCancellationToken? cancellationToken,
- ChartExportDeliveryBatchOptions batchOptions = const ChartExportDeliveryBatchOptions(),
Implementation
static Future<ChartExportDeliveryBatchResult> deliverFiles(
Iterable<ChartExportFile> files,
ChartExportDeliveryAdapter adapter, {
Duration? timeout,
ChartExportCancellationToken? cancellationToken,
ChartExportDeliveryBatchOptions batchOptions =
const ChartExportDeliveryBatchOptions(),
}) async {
final fileList = List<ChartExportFile>.unmodifiable(files);
final results = <ChartExportDeliveryResult>[];
for (final file in fileList) {
final delivery = await deliverFile(
file,
adapter,
timeout: timeout ?? batchOptions.timeout,
cancellationToken: cancellationToken ?? batchOptions.cancellationToken,
);
results.add(delivery);
_emitBatchProgress(
batchOptions,
ChartExportDeliveryBatchProgress(
completed: results.length,
total: fileList.length,
result: delivery,
),
);
if (batchOptions.stopOnFirstFailure && !delivery.success) break;
}
return ChartExportDeliveryBatchResult(results);
}