ServerInspector.start constructor

ServerInspector.start({
  1. required String runDir,
  2. required String projectRoot,
  3. required String name,
  4. int ringSize = 500,
  5. int detailsByteCap = 16 * 1024 * 1024,
  6. int? pid,
})

Starts publishing immediately, but asynchronously: events reported while the socket is still binding only land in the ring, which is where an attacher would find them anyway.

pid defaults to this process — overridable so a single-process test can stage a "restart", which is otherwise invisible: the handle key is name-pid, and two inspectors in one test share a pid.

Implementation

factory ServerInspector.start({
  required String runDir,
  required String projectRoot,
  required String name,
  int ringSize = 500,
  int detailsByteCap = 16 * 1024 * 1024,
  int? pid,
}) {
  var inspector = ServerInspector._(
    runDir: runDir,
    projectRoot: projectRoot,
    name: name,
    ringSize: ringSize,
    detailsByteCap: detailsByteCap,
    pid: pid ?? io.pid,
  );
  unawaited(inspector._publish());
  return inspector;
}