protected function boot(ContainerInterface $container)
{
$runtime = $container->make('Kraken\\Runtime\\RuntimeContainerInterface');
$channel = $container->make('Kraken\\Runtime\\Service\\ChannelInternal');
$loop = $container->make('Kraken\\Loop\\LoopInterface');
$this->applyConsoleRouting($runtime, $channel);
$runtime->on('create', function () use($channel) {
$channel->start();
});
$runtime->on('destroy', function () use($loop, $channel) {
$loop->onTick(function () use($channel) {
$channel->stop();
});
});
}