Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Streaming command output #250

Open
wrouesnel opened this issue May 16, 2018 · 3 comments
Open

Streaming command output #250

wrouesnel opened this issue May 16, 2018 · 3 comments

Comments

@wrouesnel
Copy link
Contributor

wrouesnel commented May 16, 2018

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.

@gamefundas
Copy link

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

@wrouesnel
Copy link
Contributor Author

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

@ddatsh
Copy link

ddatsh commented Mar 20, 2024

hope merge

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants