private function handleOnClose()
{
$this->client->on('close', function ($reason) {
$this->emit('close', [$reason]);
});
if (isset($this->options['onClose']) && is_callable($this->options['onClose'])) {
$this->on('close', $this->options['onClose']);
}
}