From 73933b666734ce31ec056fbd45b619a06f3ffed4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20L=C3=BCck?= Date: Thu, 22 Mar 2018 19:42:04 +0100 Subject: [PATCH] Allow throwing Exception if stream resource is not supported --- README.md | 6 ++++-- src/LoopInterface.php | 8 ++++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 6912e021..f8dfe3f6 100644 --- a/README.md +++ b/README.md @@ -499,7 +499,8 @@ checking whether it is ready to read by this loop implementation. A single stream resource MUST NOT be added more than once. Instead, either call [`removeReadStream()`](#removereadstream) first or react to this event with a single listener and then dispatch from this -listener. +listener. This method MAY throw an `Exception` if the given resource type +is not supported by this loop implementation. The listener callback function MUST be able to accept a single parameter, the stream resource added by this method or you MAY use a function which @@ -550,7 +551,8 @@ checking whether it is ready to write by this loop implementation. A single stream resource MUST NOT be added more than once. Instead, either call [`removeWriteStream()`](#removewritestream) first or react to this event with a single listener and then dispatch from this -listener. +listener. This method MAY throw an `Exception` if the given resource type +is not supported by this loop implementation. The listener callback function MUST be able to accept a single parameter, the stream resource added by this method or you MAY use a function which diff --git a/src/LoopInterface.php b/src/LoopInterface.php index 868d0a0c..c3c7219c 100644 --- a/src/LoopInterface.php +++ b/src/LoopInterface.php @@ -17,7 +17,8 @@ interface LoopInterface * A single stream resource MUST NOT be added more than once. * Instead, either call [`removeReadStream()`](#removereadstream) first or * react to this event with a single listener and then dispatch from this - * listener. + * listener. This method MAY throw an `Exception` if the given resource type + * is not supported by this loop implementation. * * The listener callback function MUST be able to accept a single parameter, * the stream resource added by this method or you MAY use a function which @@ -47,6 +48,7 @@ interface LoopInterface * * @param resource $stream The PHP stream resource to check. * @param callable $listener Invoked when the stream is ready. + * @throws \Exception if the given resource type is not supported by this loop implementation * @see self::removeReadStream() */ public function addReadStream($stream, $listener); @@ -64,7 +66,8 @@ public function addReadStream($stream, $listener); * A single stream resource MUST NOT be added more than once. * Instead, either call [`removeWriteStream()`](#removewritestream) first or * react to this event with a single listener and then dispatch from this - * listener. + * listener. This method MAY throw an `Exception` if the given resource type + * is not supported by this loop implementation. * * The listener callback function MUST be able to accept a single parameter, * the stream resource added by this method or you MAY use a function which @@ -102,6 +105,7 @@ public function addReadStream($stream, $listener); * * @param resource $stream The PHP stream resource to check. * @param callable $listener Invoked when the stream is ready. + * @throws \Exception if the given resource type is not supported by this loop implementation * @see self::removeWriteStream() */ public function addWriteStream($stream, $listener); pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy