pause method

void pause([
  1. Capability? resumeCapability
])

Pauses the isolate.

While paused, no normal messages are processed, and calls to run will be delayed until the isolate is resumed.

Commands like kill and ping are still executed while the isolate is paused.

If resumeCapability is omitted, it defaults to the isolate's Isolate.pauseCapability. If the isolate has no pause capability, nothing happens.

Calling pause more than once with the same resumeCapability has no further effect. Only a single call to resume is needed to resume the isolate.

Implementation

void pause([Capability? resumeCapability]) {
  resumeCapability ??= isolate.pauseCapability;
  if (resumeCapability == null) return;
  isolate.pause(resumeCapability);
}