1
0
mirror of https://github.com/danog/amp.git synced 2024-11-26 20:15:00 +01:00

Add additional inter-docs links

This commit is contained in:
Niklas Keller 2017-05-03 12:49:56 +02:00
parent 1a7cff7121
commit 73df7791f5
10 changed files with 41 additions and 3 deletions

View File

@ -393,3 +393,7 @@ Loop::disable($watcherId);
### Timer Drift
@TODO Discuss how repeating timer watchers are rescheduled from `$timestampAtTickStart + $watcherMsInterval` and are not subject to drift but *may* stack up if executing very slow tasks with insufficiently low intervals in-between invocations.
## Further Reading
Continue with [Promises](../promises/README.md).

View File

@ -68,3 +68,8 @@ function fromIterable($iterable, int $delay = 0) { ... }
```
`$delay` allows adding a delay between each emission.
## Further Reading
* [Iterator Combination](./combinators.md)
* [Iterator Transformation](./transformation.md)

View File

@ -9,3 +9,7 @@ Amp provides two common combination helpers for iterators: `concat` and `merge`.
## `merge()`
`merge()` accepts an array of `Iterator` instances and creates an `Iterator` that emits values emitted from any iterator in the array of iterators ending once all emitters completed.
## Further Reading
* [Iterator Transformation](./transformation.md)

View File

@ -11,3 +11,7 @@ Further primitives are very easy to implement using `Producer` with those two as
## `filter()`
`filter()` accepts an `Iterator` and a `callable` `$filter`. If `$filter($value)` returns `false` the value gets filtered, otherwise the value is retained in the resulting `Iterator`.
## Further Reading
* [Iterator Combination](./combinators.md)

View File

@ -96,3 +96,8 @@ var_dump($result); // int(42)
### Success and Failure
Sometimes values are immediately available. This might be due to them being cached, but can also be the case if an interface mandates a promise to be returned to allow for async I/O but the specific implementation always having the result directly available. In these cases `Amp\Success` and `Amp\Failure` can be used to construct a immediately resolved promise. `Amp\Success` accepts a resolution value. `Amp\Failure` accepts an exception as failure reason.
## Further Reading
* [Promise Combination](./combinators.md)
* [Other Promise Helpers](./miscellaneous.md)

View File

@ -68,3 +68,7 @@ in the component arrays are preserved from the promise array passed to the funct
`Amp\Promise\first()` resolves with the first successful result. The resulting promise will only fail if all
promises in the group fail or if the promise array is empty.
## Further Reading
* [Other Promise Helpers](./miscellaneous.md)

View File

@ -20,3 +20,7 @@ Note that `timeout()` does not cancel any operation or frees any resources. If a
## `wait()`
`wait()` can be used to synchronously wait for a promise to resolve. It returns the result value or throws an exception in case of an error. `wait()` blocks and calls `Loop::run()` internally. It SHOULD NOT be used in fully asynchronous applications, but only when integrating async APIs into an otherwise synchronous application.
## Further Reading
* [Promise Combination](./combinators.md)

View File

@ -2,7 +2,7 @@
This documentation section deals with helpers that are not async specific, but generic helpers.
* [CallableMaker](./callable-maker.md)
* [Structs](./structs.md)
* [`CallableMaker`](./callable-maker.md)
* [`Struct`](./struct.md)
Further utils for PHPUnit are provided in [`amphp/phpunit-util`](https://github.com/amphp/phpunit-util).

View File

@ -11,3 +11,7 @@ Creates a `Closure` form an instance method with the given name and returns it.
## `callableFromStaticMethod()`
Same as `callableFromInstanceMethod()`, but for static methods.
## Further Reading
* [`Struct`](./struct.md)

View File

@ -1,4 +1,4 @@
# Structs
# Struct
A struct is a generic computer science term for an object composed of public properties. The `\Amp\Stuct` trait
is intended to make using public properties a little safer by throwing an `\Error` when undefined properties
@ -42,3 +42,7 @@ The message for the thrown `\Error` will be similar to:
Although, an `\Error` being thrown in your code may cause some havoc, it will not allow for unpredictable
behavior caused by the use of properties which are not part of the class definition.
## Further Reading
* [`CallableMaker`](./callable-maker.md)