send($result); } catch (Sync\SerializationException $exception) { // Serializing the result failed. Send the reason why. yield $channel->send(new Sync\ExitFailure($exception)); } } catch (\Throwable $exception) { exit(1); // Parent context died, simply exit. } });