-
Notifications
You must be signed in to change notification settings - Fork 27
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 support for interception IO real time #67
Comments
Hmm. As you say, the essential thing you need is built into Backticks already via the
One option is to monkey patch or wrap the Backticks Runner and Command interfaces so that The cleaner option is probably to introduce a new Would that work for you? |
@xeger What if the decision on calling |
While a "tapping block" would present a superior interface to the user of
Can I ask more specifically about your use case? If you just want to see a realtime log of the container's output and don't mind blocking until On the other hand, if you need to intercept the output and do something with it in Ruby, then we do indeed need to make some changes. I still prefer a One downside of relying on If I did that, then you could write a fairly transparent wrapper around
|
Closing due to inactivity. |
Hello,
First of all, thanks for this awesome gem! I'm using the gem to build a declarative way of building and running docker & docker-compose based projects.
One feature that I really need (I already have it implemented when doing
docker
only) is that ability to get the logs of a container real time. So, for example, when I do something like:I would like to get a stream-like with the logs real time. The
docker-api
gem implementation has some functionality to do this.After looking at the code, It seems that the
shell
abstraction used by default is thebackticks
gem. The gem already provides something for real time IO inspection (Intercepting and Modifying I/O) so I think it could be possible to make it work.What if
Session#run!
accepts a block that will yield the log bytes ?Something like:
Looking forward on your thoughts @xeger and thanks before hand!
The text was updated successfully, but these errors were encountered: