Skip to content

Commit

Permalink
Formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
trowski committed Jan 26, 2025
1 parent 1a70f3a commit 7cf7fef
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,11 @@ A `CompositeCancellation` combines multiple independent cancellation objects. If
Several utility functions and classes are also included in this library.

```php
function delay(float $timeout, bool $reference = true, ?Cancellation $cancellation = null): void
function delay(
float $timeout,
bool $reference = true,
?Cancellation $cancellation = null,
): void
```

`delay` suspends the current coroutine (fiber) until the given timeout has elapsed or, if provided, the cancellation
Expand All @@ -422,15 +426,19 @@ if no other referenced events are active.

```php
/** @param int|array<int> $signals */
function trapSignal(int|array $signals, bool $reference = true, ?Cancellation $cancellation = null): int
function trapSignal(
int|array $signals,
bool $reference = true,
?Cancellation $cancellation = null,
): int
```

`trapSignal` suspends the current coroutine (fiber) until one of the given signals is received by the process or, if
provided, the cancellation is cancelled. Optionally, the underlying event-loop callback may be unreferenced, allowing
the event-loop to exit if no other referenced events are active. The signal number of the received signal is returned.

```php
now(): float
function now(): float
```

`now` returns a high-resolution time relative to an arbitrary point in time. This function may be used to calculate
Expand All @@ -442,7 +450,7 @@ time differences independent of wall-time.
* @param Closure(...):TReturn $closure
* @return Closure(...):TReturn
*/
function weakClosure(\Closure $closure): \Closure
function weakClosure(Closure $closure): Closure
```

`weakClosure` wraps a given closure, returning a new `Closure` instance which maintains a weak-reference to any
Expand Down

0 comments on commit 7cf7fef

Please sign in to comment.