3 ms·
YES PLEASE. Give us a GET on /events with support for hanging GETs. A hanging GET is where you get chunked encoding (which is the only option in HTTP/2 anyway
by cryptonector 5y ago
YES PLEASE. Give us a GET on /events with support for hanging GETs.
A hanging GET is where you get chunked encoding (which is the only option in HTTP/2 anyways) and possibly never-ending stream. I've implemented a (proprietary, for now) "tail -f" over HTTP that does this when Range: bytes=0- (i.e., end offset not specified), completing the transfer (i.e., final, empty chunk sent) only whenever the file is removed or renamed away.
You'll want to add a heartbeat to any hanging GET /events.
- cryptonector 5y agoMy little tail-f-over-http server is for plain files, but this scheme works for anything. Of course, if you can output an indefinite stream (e.g., PG NOTIFYs, build logs, etc.) you can redirect that to a file and then serve up that file.