-
-
Notifications
You must be signed in to change notification settings - Fork 66
/
Http2Stream.php
100 lines (77 loc) · 2.02 KB
/
Http2Stream.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
<?php
namespace Amp\Http\Client\Connection\Internal;
use Amp\CancellationToken;
use Amp\Deferred;
use Amp\Emitter;
use Amp\Http\Client\Connection\Stream;
use Amp\Http\Client\Internal\ForbidCloning;
use Amp\Http\Client\Internal\ForbidSerialization;
use Amp\Http\Client\Request;
use Amp\Http\Client\Response;
use Amp\Struct;
/**
* Used in Http2Connection.
*
* @internal
*/
final class Http2Stream
{
use Struct;
use ForbidSerialization;
use ForbidCloning;
/** @var int */
public $id;
/** @var Request */
public $request;
/** @var Response|null */
public $response;
/** @var Deferred */
public $pendingResponse;
/** @var bool */
public $responsePending = true;
/** @var Emitter|null */
public $body;
/** @var Deferred|null */
public $trailers;
/** @var CancellationToken */
public $cancellationToken;
/** @var int Bytes received on the stream. */
public $received = 0;
/** @var int */
public $serverWindow;
/** @var int */
public $clientWindow;
/** @var string */
public $requestBodyBuffer = '';
/** @var bool */
public $requestBodyComplete = false;
/** @var Deferred */
public $requestBodyCompletion;
/** @var int Integer between 1 and 256 */
public $weight = 16;
/** @var int */
public $dependency = 0;
/** @var int|null */
public $expectedLength;
/** @var Stream */
public $stream;
/**@var Deferred|null */
public $windowSizeIncrease;
public function __construct(
int $id,
Request $request,
Stream $stream,
CancellationToken $cancellationToken,
int $serverSize,
int $clientSize
) {
$this->id = $id;
$this->request = $request;
$this->stream = $stream;
$this->cancellationToken = $cancellationToken;
$this->serverWindow = $serverSize;
$this->clientWindow = $clientSize;
$this->pendingResponse = new Deferred;
$this->requestBodyCompletion = new Deferred;
}
}