Skip to content

Commit 85eff1b

Browse files
committed
Document streaming support
1 parent 6e1c5b4 commit 85eff1b

1 file changed

Lines changed: 23 additions & 0 deletions

File tree

README.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,29 @@ $ aws lambda update-function-code \
106106
--publish
107107
```
108108
109+
Streaming
110+
---------
111+
This library implements HTTP response streaming, improving TTFB and memory consumption of web applications. Response streaming is available for lambda function URLs which have their invoke mode set to *RESPONSE_STREAM*.
112+
113+
Inherit from the *HttpStreaming* base class instead of *HttpApi*:
114+
115+
```php
116+
use com\amazon\aws\lambda\HttpStreaming;
117+
118+
class Greet extends HttpStreaming {
119+
120+
public function routes($env) {
121+
/* Shortened for brevity */
122+
}
123+
}
124+
```
125+
126+
Next, deploy the change, then update the function configuration:
127+
128+
```bash
129+
$ aws lambda update-function-url-config --function-name greet --invoke-mode RESPONSE_STREAM
130+
```
131+
109132
Request context
110133
---------------
111134
The request context passed via the *request* value is defined as follows:

0 commit comments

Comments
 (0)