1
0
mirror of https://github.com/danog/amp.git synced 2024-12-11 08:59:46 +01:00
amp/lib/Loop/InvalidWatcherError.php

33 lines
810 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.
*/
2020-10-09 19:37:37 +02:00
final class InvalidWatcherError extends \Error
2018-06-18 20:00:01 +02:00
{
/** @var string */
2020-10-09 19:37:37 +02:00
private string $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.
*/
2020-10-09 19:37:37 +02:00
public function getWatcherId(): string
2018-06-18 20:00:01 +02:00
{
return $this->watcherId;
}
}