getInstance static method

Future<Reaper> getInstance()

Returns the singleton Reaper, creating it if necessary.

On first call, starts the Ryuk container, waits for it to become ready, connects a TCP socket, and sends the session-ID registration message.

Concurrent calls that arrive before initialisation completes share the same Future and will all receive the same Reaper instance.

Throws ContainerConnectException when the Ryuk container's host/port cannot be determined, or when all 50 TCP connection attempts fail.

Implementation

static Future<Reaper> getInstance() => _initFuture ??= _createInstance();