requireShared method

  1. @protected
void requireShared(
  1. String reason
)

Refuses then on this job from now on, with reason in the error: every continuation is a handle of shared.

For an engine that hands one job to more than one caller. A job is continued once, so a plain then by one caller would make then and shared throw for the next one, and which caller throws would depend on who came first. With the mark, then throws for every caller, the first one included, and on the first call. reason completes the job's name: is handed to every caller of its key reads Job(load) is handed to every caller of its key: continue it through shared(), a handle for each caller.

Mark the job before it is handed out. A then taken earlier stays, and shared throws next to it as it would without the mark. A second call keeps the first reason.

Implementation

@protected
void requireShared(String reason) => _sharedOnly ??= reason;