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 console output to the frontend #2

Open
elek opened this issue Sep 28, 2022 · 1 comment
Open

Streaming console output to the frontend #2

elek opened this issue Sep 28, 2022 · 1 comment

Comments

@elek
Copy link
Owner

elek commented Sep 28, 2022

Backend calls good old CLI commands under the hood (see backend/service.go). If it fails, it returns with an error (including stdout).

But some of the commands (like docker push) are quite slow.

It would be better to start the command and continuously streaming the output to the frontend which would show new lines immediately.

In the current, very simple prototype, we just wait until the response is received.

@Ajax-Light
Copy link

Hey @elek I'd like to work on this. I'm new to go so I wanna take this up as a challenge. A quick search has led me to io.Reader and io.Writer. So the plan is to use c.Stdout which is an io.Writer according to Go docs and use it to write to logs instead of zap.String("output", string(out)). Does this look okay?

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

2 participants