Skip to content

Core\Response\Stream

A response body that your program sends in parts. Core\Response::startStream() returns it, and its write() method sends each part. The body ends when the program ends, or when your program calls end().

Returned by

You get a Core\Response\Stream from these methods:

Members

4 members.

MemberSignature
writewrite(string|bytes $chunk): void
offsetoffset(): int
lengthlength(): int
endend(): void

Example apps

These complete apps use this class. You can download and run each one.

  • Notes: A small notes app with SQLite, HTML pages, a JSON API, form checks and tests. Download it, run it and start your own app from it.
  • Poll: A live poll with SQLite and server-sent events. Every open page shows each new vote at once, with no extra server and no library.