/** * Inform the coroutine that the executing strand is being terminated. * * @param StrandInterface $strand The strand that is executing the coroutine. */ public function terminate(StrandInterface $strand) { $strand->emit('terminate', [$strand]); $strand->emit('exit', [$strand]); $strand->removeAllListeners(); $strand->suspend(); }