def attach(options = {}, excon_params = {}, &block)
stdin = options.delete(:stdin)
tty = options.delete(:tty)
opts = {
:stream => true, :stdout => true, :stderr => true
}.merge(options)
msgs = Docker::Messages.new
if stdin
opts[:stdin] = true
excon_params[:hijack_block] = Docker::Util.hijack_for(stdin, block,
msgs, tty)
else
excon_params[:response_block] = Docker::Util.attach_for(block, msgs, tty)
end
connection.post(
path_for(:attach),
opts,
excon_params
)
[msgs.stdout_messages, msgs.stderr_messages]
end