public function emit($event, array $args) { $this->write(static::EVENT, json_encode(['name' => $event, 'args' => $args])); }