Skip to content

Commit

Permalink
Prefer non-bang async method, and sleep so the example succeeds
Browse files Browse the repository at this point in the history
Without the sleep, you never see that it worked.
  • Loading branch information
Josh Adams committed Apr 25, 2013
1 parent f4648eb commit 30bf412
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class Server
end

def run
loop { handle_message! @socket.read }
loop { async.handle_message @socket.read }
end

def handle_message(message)
Expand Down Expand Up @@ -95,8 +95,10 @@ addr = 'tcp://127.0.0.1:3435'
server = Server.new(addr)
client = Client.new(addr)

server.run!
server.async.run
client.write('hi')

sleep
```

Copyright
Expand Down

0 comments on commit 30bf412

Please sign in to comment.