-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a353a2e
commit deee337
Showing
6 changed files
with
336 additions
and
86 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
A <span lang="java">@io.ably.realtime.CompletionListener@</span> is an interface allowing a client to be notified of the outcome of an asynchronous operation. | ||
|
||
```[java] | ||
public interface CompletionListener { | ||
// Called when the associated operation completes successfully, | ||
public void onSuccess(); | ||
|
||
// Called when the associated operation completes with an error. | ||
public void onError(ErrorInfo reason); | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
blang[java]. | ||
@io.ably.realtime.ConnectionState@ is an enum representing all the "@Realtime Connection@ states":/realtime/connection#connection-states. | ||
|
||
```[java] | ||
public enum ConnectionState { | ||
initialized, // 0 | ||
connecting, // 1 | ||
connected, // 2 | ||
disconnected, // 3 | ||
suspended, // 4 | ||
closing, // 5 | ||
closed, // 6 | ||
failed // 7 | ||
} | ||
``` | ||
|
||
blang[ruby]. | ||
@Ably::Realtime::Connection::STATE@ is an enum-like value representing all the "@Realtime Connection@ states":/realtime/connection#connection-states. @STATE@s can be represented interchangeably as either symbols or constants. | ||
|
||
h4. Symbol states | ||
|
||
```[ruby] | ||
:initialized # => 0 | ||
:connecting # => 1 | ||
:connected # => 2 | ||
:disconnected # => 3 | ||
:suspended # => 4 | ||
:closing # => 5 | ||
:closed # => 6 | ||
:failed # => 7 | ||
``` | ||
|
||
h4. Constant states | ||
|
||
```[ruby] | ||
Connection::STATE.Initialized # => 0 | ||
Connection::STATE.Connecting # => 1 | ||
Connection::STATE.Connected # => 2 | ||
Connection::STATE.Disconnected # => 3 | ||
Connection::STATE.Suspended # => 4 | ||
Connection::STATE.Closing # => 5 | ||
Connection::STATE.Closed # => 6 | ||
Connection::STATE.Failed # => 7 | ||
``` | ||
|
||
h4. Example usage | ||
|
||
```[ruby] | ||
# Example with symbols | ||
client.connection.on(:connected) { ... } | ||
|
||
# Example with constants | ||
client.connection.on(Ably::Realtime::Connection::STATE.Connected) { ... } | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
A <span lang="java">@io.ably.realtime.ConnectionStateListener.ConnectionStateChange@</span><span lang="default">@ConnectionStateChange@</span> is a type encapsulating state change information emitted by an object that implements an @EventEmitter@ | ||
This comment has been minimized.
Sorry, something went wrong. |
||
|
||
h4. | ||
default: Properties | ||
java: Members | ||
ruby: Attributes | ||
|
||
- @previous@ := the previous state<br>__Type: <span lang="default">String</span><span lang="java">ConnectionState</span>__ | ||
- @current@ := the new state<br>__Type: <span lang="default">String</span><span lang="java">ConnectionState</span>__ | ||
- @reason@ := an "@ErrorInfo@":#error-info containing any information relating to the transition<br>__Type: "@ErrorInfo@":#error-info__ | ||
- <span lang="default">@retryIn@</span><span lang="ruby">@retry_in@</span> := Timestamp at which the library will retry a connection where applicable, as milliseconds since the epoch<br>__Type: <span lang="default">Integer</span><span lang="java">Long Integer</span><span lang="ruby">Time</span>__ |
no period at end of para