Open alsemenov opened 7 years ago
There is nothing inherently special about the terminate capability. A capability is just an unforgeable, send-port sendable token. You can use it for pausing, and all it means is that you must send the same capability again when resuming.
The description for method Isolate.resume() reads:
Description for method Isolate.pause() reads:
So it is possible to use Capability instance, supplied by programmer, for pause and resume. There are two special values
null
andIsolate.terminateCapability
among others. Thenull
case is covered by the specification. However theIsolate.terminateCapability
case is not clear. Is this value considered as invalid? Should it be ignored or an error should be raised?There is a similar case in
Isolate
constructor. It takes pause capability and terminate capability as arguments. Is it ok, if the same instance will be supplied for both?