pushChunk method

Future<int> pushChunk(
  1. List<List> samples, {
  2. double? timestamp,
  3. List<double>? timestamps,
  4. bool? pushthrough,
})

Pushes a chunk of samples to the outlet.

Parameters:

  • samples: One list of channelCount values per sample.
  • timestamp: Optional capture time of the last sample (0.0/null = now); earlier samples are spaced backwards by the sampling rate.
  • timestamps: Optional per-sample timestamps (length must equal samples.length); mutually exclusive with timestamp.
  • pushthrough: Optionally override the outlet's chunking for this push (true = send immediately).

Chunk transfer trades per-sample latency for throughput: one native call (and, with a matching chunkSize, one network write) moves the whole block. Works for every format except undefined (void); string values must not contain NUL bytes (see pushChunkBytes).

Returns: Error code (0 = success).

See also: pushChunkSync, pushChunkTyped

Implementation

Future<int> pushChunk(
  List<List<dynamic>> samples, {
  double? timestamp,
  List<double>? timestamps,
  bool? pushthrough,
}) => _useIsolates
    ? _pushChunkIsolated(samples, timestamp, timestamps, pushthrough)
    : Future.value(
        _pushChunkDirect(samples, timestamp, timestamps, pushthrough),
      );