appendToDataStreams method
Append a batch
of data measures to corresponding data streams
in studyDeploymentId
.
Throws IllegalArgumentException when:
- the
studyDeploymentId
of one or more sequences inbatch
does not matchstudyDeploymentId
- the start of one or more of the sequences contained in
batch
precede the end of a previously appended sequence to the same data stream batch
contains a sequence withDataStreamId
which wasn't configured forstudyDeploymentId
Throws IllegalStateException when data streams for studyDeploymentId
have been closed.
Implementation
@override
Future<void> appendToDataStreams(
String studyDeploymentId,
List<DataStreamBatch> batch, {
bool compress = true,
}) async {
final payload = AppendToDataStreams(studyDeploymentId, batch);
if (compress) {
// compress the payload and POST the byte stream to the zip endpoint
_endpointName = DATA_STREAM_ZIP_ENDPOINT_NAME;
await _post(
Uri.encodeFull(rpcEndpointUri),
body: zipJson(payload.toJson()),
);
} else {
await _rpc(payload, DATA_STREAM_ENDPOINT_NAME);
}
}