Skip to content

Using stderr instead of sockets #291

Open

Description

@kostya

can simplify code by much:

how xtime can do it:

r, w = IO.pipe
pid = Process.spawn(*["ruby", "-e", "5.times do; STDERR.puts('msg'); sleep 1; end"], {err: w})

Thread.new do
  while true
    if IO.select([r])
      p r.read_nonblock(1024)
    end
  end
end

Process.wait(pid)
w.close
r.close

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions