How to read from socket in non-blocking mode

You do all your processing in a task.

@async begin
while !eof(socket)
line = readline(socket)
# process line
end
end