Skip to content

Commit ccb2180

Browse files
AndrewCarterUKbwoebi
authored andcommitted
Clarified that cancel() can be used to prevent a memory leak (#75)
1 parent 289b0fe commit ccb2180

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/Loop.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,8 @@ public static function disable($watcherId)
241241
}
242242

243243
/**
244-
* Cancel a watcher. This marks the watcher identifier as invalid.
244+
* Cancel a watcher. This will detatch the event loop from all resources that are associated to the watcher. After this
245+
* operation the watcher is permanently invalid.
245246
*
246247
* @param string $watcherId The watcher identifier.
247248
*

src/Loop/Driver.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,9 @@ public function enable($watcherId);
128128
public function disable($watcherId);
129129

130130
/**
131-
* Cancel a watcher. This marks the watcher as invalid. Calling this function MUST never fail, even when passed an invalid watcher.
131+
* Cancel a watcher. This will detatch the event loop from all resources that are associated to the watcher. After this
132+
* operation the watcher is permanently invalid. Calling this function MUST never fail, even when passed an invalid
133+
* watcher.
132134
*
133135
* @param string $watcherId The watcher identifier.
134136
*

0 commit comments

Comments
 (0)