webhook icon indicating copy to clipboard operation
webhook copied to clipboard

Streaming command output

Open wrouesnel opened this issue 7 years ago • 3 comments

I'd like to propose extending webhook to support streaming command output. The idea would be to add an extra option like stream_stdout_as_response which would mean the executed command would be streamed back rather then buffered up before being returned.

The protocol would be that a 200 OK response would be returned so long as the command wrote at least 1 byte of stdout before exiting. If the command exits non-zero without writing anything, then a regular error message would be returned.

My use-case here is using webhook to add large data export functionality to some of my docker containers - i.e. POST here to run pg_basebackup in the background and write the tar file back to the requester.

Update: I've finished the draft of implementing this here: https://github.com/wrouesnel/webhook/tree/streaming_responses I'll submit a PR once I get the tests fixed and validated.

wrouesnel avatar May 16 '18 03:05 wrouesnel

@wrouesnel any chance the streamed output changes can be merged to this project?

gamefundas avatar Sep 25 '18 15:09 gamefundas

@gamefundas see #251 for the PR and support it there.

wrouesnel avatar Sep 26 '18 11:09 wrouesnel

hope merge

ddatsh avatar Mar 20 '24 02:03 ddatsh