Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
Signed-off-by: Lewis Marshall <lewis@lmars.net>
  • Loading branch information
lmars committed Nov 13, 2015
1 parent 21d1a67 commit 6596d62
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions README.md
Expand Up @@ -48,22 +48,23 @@ client = Ably::Realtime.new(key: 'xxxxx')
client = Ably::Realtime.new(token: 'xxxxx')
```

### Connection

Successful connection:
and that a connection has been established:

```ruby
client.connection.connect do
# successful connection
end
```

Failed connection:
Connection errors can be handled by registering an errback:

```ruby
connection_result = client.connection.connect
connection_result.callback = Proc.new do
# successful connection
end
connection_result.errback = Proc.new do
# failed connection
# handle failed connection
end
```

Expand Down

0 comments on commit 6596d62

Please sign in to comment.