pullChunk method

Future<LSLChunk<T>> pullChunk({
  1. int maxSamples = 512,
  2. double timeout = 0.0,
})

Pulls a chunk of buffered samples from the inlet.

Parameters:

  • maxSamples: Upper bound on samples returned per call (default: 512).
  • timeout: How long to keep waiting for more samples. liblsl keeps pulling until maxSamples samples have been read or timeout expires, so a nonzero timeout with a maxSamples larger than what arrives always waits the full timeout. The default 0.0 returns immediately with whatever is already buffered (up to maxSamples).

Returns: An LSLChunk with one list per sample and one timestamp per sample; empty if nothing arrived within timeout.

See also: pullChunkSync, pullChunkTyped

Implementation

Future<LSLChunk<T>> pullChunk({int maxSamples = 512, double timeout = 0.0}) =>
    _useIsolates
    ? _pullChunkIsolated(maxSamples, timeout)
    : Future.value(_pullChunkDirect(maxSamples, timeout));