From 6596d62eb7e031080fd54df83762fb6d6108e988 Mon Sep 17 00:00:00 2001 From: Lewis Marshall Date: Fri, 13 Nov 2015 23:10:26 +0000 Subject: [PATCH] Update README.md Signed-off-by: Lewis Marshall --- README.md | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 1238042db..5b25408c2 100644 --- a/README.md +++ b/README.md @@ -48,9 +48,7 @@ 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 @@ -58,12 +56,15 @@ client.connection.connect do 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 ```