-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Also add algorithm how to add new engine in the `CONTRIBUTING.md` guide
- Loading branch information
Showing
8 changed files
with
148 additions
and
11 deletions.
There are no files selected for viewing
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
12 changes: 12 additions & 0 deletions
12
network-client-core/src/main/java/io/ably/lib/network/HttpCall.java
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 |
---|---|---|
@@ -1,6 +1,18 @@ | ||
package io.ably.lib.network; | ||
|
||
/** | ||
* Cancelable Http request call | ||
* <p/> | ||
* Implementation should be thread-safe | ||
*/ | ||
public interface HttpCall { | ||
/** | ||
* Synchronously execute Http request and return response from te server | ||
*/ | ||
HttpResponse execute(); | ||
|
||
/** | ||
* Cancel pending Http request | ||
*/ | ||
void cancel(); | ||
} |
12 changes: 12 additions & 0 deletions
12
network-client-core/src/main/java/io/ably/lib/network/HttpEngine.java
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 |
---|---|---|
@@ -1,6 +1,18 @@ | ||
package io.ably.lib.network; | ||
|
||
/** | ||
* An HTTP engine instance that can make cancelable HTTP requests. | ||
* It contains some engine-wide configurations, such as proxy settings, | ||
* if it operates under a corporate proxy. | ||
*/ | ||
public interface HttpEngine { | ||
/** | ||
* @return cancelable Http request call | ||
*/ | ||
HttpCall call(HttpRequest request); | ||
|
||
/** | ||
* @return <code>true</code> if it uses proxy, <code>false</code> otherwise | ||
*/ | ||
boolean isUsingProxy(); | ||
} |
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
3 changes: 3 additions & 0 deletions
3
network-client-core/src/main/java/io/ably/lib/network/WebSocketEngine.java
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 |
---|---|---|
@@ -1,5 +1,8 @@ | ||
package io.ably.lib.network; | ||
|
||
/** | ||
* Create WebSocket client bind to the specific URL | ||
*/ | ||
public interface WebSocketEngine { | ||
WebSocketClient create(String url, WebSocketListener listener); | ||
} |
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