Skip to content

Commit

Permalink
Merge pull request #24 from knewter/update-readme-example
Browse files Browse the repository at this point in the history
Prefer non-bang async method, and sleep so the example succeeds
  • Loading branch information
tarcieri committed Apr 25, 2013
2 parents 9232e40 + 30bf412 commit 5770de5
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 5770de5

Please sign in to comment.