Ruby (and most languages) evaluates the arguments before passing them through to the function. So it first evaluates server.accept, which blocks until a new connection, then passes the return value through to Thread.new which spawns the new thread.
The parameters to Thread.new are just passed straight through to the block.
Comments
Ruby (and most languages) evaluates the arguments before passing them through to the function. So it first evaluates server.accept, which blocks until a new connection, then passes the return value through to Thread.new which spawns the new thread.
The parameters to Thread.new are just passed straight through to the block.
Ahhh! I thought it was passing the accept function and not its result. Been too long, ruby! Thanks guys :)