/** * Close the current stream. * * @return void */ public final function close() { $streamName = $this->getStreamName(); $name = md5($streamName); if (!isset(self::$_register[$name])) { return; } Event::notify('hoa://Event/Stream/' . $streamName . ':close-before', $this, new Event\Bucket()); if (false === $this->_close()) { return; } unset(self::$_register[$name]); $this->_bucket[self::HANDLER] = null; Event::unregister('hoa://Event/Stream/' . $streamName); Event::unregister('hoa://Event/Stream/' . $streamName . ':close-before'); return; }
/** * Send the exception on hoa://Event/Exception. * * @return void */ public function send() { Event::notify('hoa://Event/Exception', $this, new Event\Bucket($this)); return; }