Skip to content

Calling close_write on io if necessary#251

Merged
tlunter merged 2 commits into
masterfrom
close-write
Feb 12, 2015
Merged

Calling close_write on io if necessary#251
tlunter merged 2 commits into
masterfrom
close-write

Conversation

@tlunter
Copy link
Copy Markdown
Contributor

@tlunter tlunter commented Feb 12, 2015

Finishes #240 by fixing the ABC complexity error

@bfulton @nahiluhmot @jschneiderhan @myers

This seemed to work appropriately when I tried it locally. I would expect the small script I wrote (attached) to hang since the write end would never be closed, but it ends and prints the output from cat.

require 'docker'

Docker.options[:ssl_verify_peer] = false

image = Docker::Image.create('fromImage' => 'ubuntu:14.04')

container = Docker::Container.create('Image' => 'ubuntu', 'Cmd' => ['cat'], 'OpenStdin' => true, 'StdinOnce' => true)
puts container.tap(&:start).attach(stdin: StringIO.new("foo\nbar\n"))

@bfulton
Copy link
Copy Markdown
Contributor

bfulton commented Feb 12, 2015

+1

tlunter added a commit that referenced this pull request Feb 12, 2015
Calling `close_write` on io if necessary
@tlunter tlunter merged commit 8738f22 into master Feb 12, 2015
@tlunter tlunter deleted the close-write branch February 12, 2015 00:40
spraints added a commit to spraints/hoosegow that referenced this pull request Jun 16, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants