Skip to content

Commit

Permalink
Document streaming support
Browse files Browse the repository at this point in the history
  • Loading branch information
thekid committed Nov 20, 2023
1 parent 6e1c5b4 commit 85eff1b
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,29 @@ $ aws lambda update-function-code \
--publish
```
Streaming
---------
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*.
Inherit from the *HttpStreaming* base class instead of *HttpApi*:
```php
use com\amazon\aws\lambda\HttpStreaming;

class Greet extends HttpStreaming {

public function routes($env) {
/* Shortened for brevity */
}
}
```
Next, deploy the change, then update the function configuration:
```bash
$ aws lambda update-function-url-config --function-name greet --invoke-mode RESPONSE_STREAM
```
Request context
---------------
The request context passed via the *request* value is defined as follows:
Expand Down

0 comments on commit 85eff1b

Please sign in to comment.