waitForConsumer method

Future<bool> waitForConsumer({
  1. double timeout = 60.0,
})

Waits for a consumer (e.g. LabRecorder, another inlet) to connect to the outlet.

Parameters:

  • timeout: Maximum wait time in seconds (default: 60.0)

Execution:

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

Returns: true if a consumer is found, false if timeout occurs.

See also: waitForConsumerSync for zero-overhead direct calls

Implementation

Future<bool> waitForConsumer({double timeout = 60.0}) => _useIsolates
    ? _waitForConsumerIsolated(timeout)
    : Future.value(_waitForConsumerDirect(timeout));