pushSample method

Future<int> pushSample(
  1. Iterable data, {
  2. double? timestamp,
  3. bool? pushthrough,
})

Pushes a sample to the outlet.

Parameters:

  • data: List of values that will be used to initialize the sample. The type should match the channel format and length should match the channel count.
  • timestamp: Optional capture time in LSL.localClock seconds (0.0/null = now). Use this to back-date a sample to when it was actually acquired rather than when it was pushed.
  • pushthrough: Optionally override the outlet's chunking for this sample; true sends it immediately, false lets liblsl batch it with subsequent samples (liblsl's default is true).

Execution:

  • Isolated mode: Async message passing to worker isolate
  • Direct mode: Immediate FFI call wrapped in Future

Returns: Error code (0 = success).

See also: pushSampleSync for zero-overhead direct calls

Implementation

Future<int> pushSample(
  Iterable<dynamic> data, {
  double? timestamp,
  bool? pushthrough,
}) => _useIsolates
    ? _pushSampleIsolated(data, timestamp, pushthrough)
    : Future.value(_pushSampleDirect(data, timestamp, pushthrough));