public function __construct($config = [], $init = true)
{
$this->config = $config;
if ($this->connectionClass === null) {
$e = explode('\\', get_class($this));
$e[sizeof($e) - 1] = 'Connection';
$this->connectionClass = '\\' . implode('\\', $e);
}
if ($this->eventLoop === null) {
$this->eventLoop = EventLoop::$instance;
}
$this->onConfigUpdated();
if ($init) {
$this->init();
}
}