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

Add capture_buffer option #23

Merged
merged 4 commits into from
Jan 16, 2024
Merged

Conversation

goerz
Copy link
Member

@goerz goerz commented Jan 12, 2024

Giving a non-standard capture_buffer allows to dynamically process the captured output in arbitrary ways. For example, a custom buffer may discard part of some very large output. The object passed as capture_buffer must implement two methods:
Base.write(capture_buffer, bytes) and
bytes = Base.take!(capture_buffer).

Closes #21

@goerz
Copy link
Member Author

goerz commented Jan 12, 2024

This is the same as #22, just as an officially documented feature

@MichaelHatherly
Copy link
Member

I'm fine with it just being an documented keyword like this. It's not really changing the complexity of the implementation much.

@mortenpi
Copy link
Member

I agree, I think this is perfectly fine to have as a proper feature, to give users a bit more power. Could we just have a few simple tests, preferably also one that interacts with #23, and a CHANGELOG note?

@goerz
Copy link
Member Author

goerz commented Jan 15, 2024

Will do! Agreed on the test, so we should probably merge #23 first, and I'll rebase and adapt this PR, afterward.

Giving a non-standard `capture_buffer` allows to dynamically process the
captured output in arbitrary ways. For example, a custom buffer may
discard part of some very large output. The object passed as
`capture_buffer` must implement two methods:
`Base.write(capture_buffer, bytes)` and
`bytes = Base.take!(capture_buffer)`.
@goerz
Copy link
Member Author

goerz commented Jan 15, 2024

Ok, rebased, added test and documentation for how passthrough and capture_buffer interact.

Should be good to go!

@mortenpi mortenpi added the enhancement New feature or request label Jan 15, 2024
@goerz goerz mentioned this pull request Jan 16, 2024
@MichaelHatherly MichaelHatherly merged commit 9f28ede into JuliaDocs:master Jan 16, 2024
17 checks passed
@goerz goerz deleted the mg/capture-buffer branch January 16, 2024 19:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Limit captured output
3 participants