-
-
Notifications
You must be signed in to change notification settings - Fork 257
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
26 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<?php | ||
|
||
namespace Amp; | ||
|
||
interface Closable | ||
{ | ||
/** | ||
* Closes the resource, marking it as unusable. | ||
* Whether pending operations are aborted or not is implementation dependent. | ||
*/ | ||
public function close(): void; | ||
|
||
/** | ||
* Returns whether this resource has been closed. | ||
* | ||
* @return bool {@code true} if closed, otherwise {@code false} | ||
*/ | ||
public function isClosed(): bool; | ||
|
||
/** | ||
* Registers a callback that is invoked when this resource is closed. | ||
* | ||
* @param \Closure():void $onClose | ||
*/ | ||
public function onClose(\Closure $onClose): void; | ||
} |