Kraken\Channel\Channel::__construct PHP Метод

__construct() публичный Метод

public __construct ( string $name, Kraken\Channel\ChannelModelInterface $model, Kraken\Channel\Router\RouterCompositeInterface $router, Kraken\Channel\Encoder\EncoderInterface $encoder, Kraken\Loop\LoopInterface $loop )
$name string
$model Kraken\Channel\ChannelModelInterface
$router Kraken\Channel\Router\RouterCompositeInterface
$encoder Kraken\Channel\Encoder\EncoderInterface
$loop Kraken\Loop\LoopInterface
    public function __construct($name, ChannelModelInterface $model, RouterCompositeInterface $router, EncoderInterface $encoder, LoopInterface $loop)
    {
        parent::__construct($loop);
        try {
            $router->getBus('input');
            $router->getBus('output');
        } catch (Exception $ex) {
            throw new InstantiationException("Could not construct Kraken\\Channel\\Channel due to Router wrong configuration.");
        }
        $this->name = $name;
        $this->model = $model;
        $this->router = $router;
        $this->encoder = $encoder;
        $this->loop = $loop;
        $this->handlers = [];
        $this->seed = GeneratorSupport::genId($this->name);
        $this->counter = 1000000000.0;
        $this->reqsHelperTimer = null;
        $this->repsHelperTimer = null;
        $this->handledRepsTimeout = 10000.0;
        $this->registerEvents();
        $this->registerPeriodicTimers();
    }