1
0
mirror of https://github.com/danog/amp.git synced 2024-12-13 09:57:25 +01:00
amp/lib/Loop/InvalidWatcherError.php

33 lines
789 B
PHP
Raw Normal View History

<?php
2017-03-10 19:19:32 +01:00
namespace Amp\Loop;
/**
* MUST be thrown if any operation (except disable() and cancel()) is attempted with an invalid watcher identifier.
*
* An invalid watcher identifier is any identifier that is not yet emitted by the driver or cancelled by the user.
*/
2018-06-18 20:00:01 +02:00
class InvalidWatcherError extends \Error
{
/** @var string */
private $watcherId;
/**
* @param string $watcherId The watcher identifier.
* @param string $message The exception message.
*/
2018-06-18 20:00:01 +02:00
public function __construct(string $watcherId, string $message)
{
$this->watcherId = $watcherId;
parent::__construct($message);
}
/**
* @return string The watcher identifier.
*/
2018-06-18 20:00:01 +02:00
public function getWatcherId()
{
return $this->watcherId;
}
}