You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The `first(ReadableStreamInterface|WritableStreamInterface $stream, string $event = 'data'): PromiseInterface<mixed,Exception>` function can be used to
87
-
create a `Promise` which resolves once the given event triggers for the first time.
86
+
The `first(ReadableStreamInterface|WritableStreamInterface $stream, string $event = 'data'): PromiseInterface<mixed,RuntimeException>` function can be used to
87
+
create a `Promise` which will be fulfilled once the given event triggers for the first time.
The promise will resolve with whatever the first event emitted or `null` if the
98
-
event does not pass any data.
97
+
The promise will be fulfilled with a `mixed` value of whatever the first event
98
+
emitted or `null` if the event does not pass any data.
99
99
If you do not pass a custom event name, then it will wait for the first "data"
100
-
event and resolve with a string containing the first data chunk.
100
+
event.
101
+
For common streams of type `ReadableStreamInterface<string>`, this means it will be
102
+
fulfilled with a `string` containing the first data chunk.
101
103
102
-
The promise will reject if the stream emits an error – unless you're waiting for
103
-
the "error" event, in which case it will resolve.
104
+
The promise will be rejected with a `RuntimeException`if the stream emits an error
105
+
– unless you're waiting for the "error" event, in which case it will be fulfilled.
104
106
105
-
The promise will reject once the stream closes – unless you're waiting for the
106
-
"close" event, in which case it will resolve.
107
+
The promise will be rejected with a `RuntimeException` once the stream closes
108
+
– unless you're waiting for the "close" event, in which case it will be fulfilled.
107
109
108
-
The promise will reject if the stream is already closed.
110
+
The promise will be rejected with a `RuntimeException` if the stream is already closed.
109
111
110
-
The promise will reject if it is cancelled.
112
+
The promise will be rejected with a `RuntimeException` if it is cancelled.
111
113
112
114
### all()
113
115
114
-
The `all(ReadableStreamInterface|WritableStreamInterface $stream, string $event = 'data'): PromiseInterface<array,Exception>` function can be used to
115
-
create a `Promise` which resolves with an array of all the event data.
116
+
The `all(ReadableStreamInterface|WritableStreamInterface $stream, string $event = 'data'): PromiseInterface<array,RuntimeException>` function can be used to
117
+
create a `Promise` which will be fulfilled with an array of all the event data.
0 commit comments