Aerys\BodyParser class BodyParser implements Amp\Promise

Summary

Properties

Methods

Properties

Methods

__construct — public function __construct(Aerys\Request $req, array $options = [])
No documentation.
Type Parameter Description Default Value
Aerys\Request $req No documentation. none
array $options available options are: - size (default: 131072) - input_vars (default: 200) - field_len (default: 16384) []
when — public function when(callable $cb, mixed $cbData = null)

Notify the $cb callback when the promise resolves (whether successful or not)

Implementations MUST invoke the $cb callback in error-first style, e.g.:

<?php
$promise->when(function(\Exception $error = null, $result = null) {
    if ($error) {
        // failed
    } else {
        // succeeded
    }
});

Implementations MUST return the current object instance.

Type Parameter Description Default Value
callable $cb An error-first callback to invoke upon promise resolution none
mixed $cbData Optional data to pass as a third parameter to $cb null
watch — public function watch(callable $cb, mixed $cbData = null)

Notify the $cb callback when resolution progress events are emitted

Implementations MUST invoke $cb callback with a single update parameter, e.g.:

<?php
$promise->watch(function($update) { ... });

Implementations MUST return the current object instance.

Type Parameter Description Default Value
callable $cb A callback to invoke when data updates are available none
mixed $cbData Optional data to pass as an additional parameter to $cb null
stream — public function stream(string $name, int $size = 0): Aerys\FieldBody
No documentation.
Type Parameter Description Default Value
string $name field name none
int $size <= 0: use last size, if none present, count toward total size, else separate size just respecting value size none