Skip to content

Commit 7538151

Browse files
committed
Add documentation on cancelling single requests to the README.
1 parent 10cad62 commit 7538151

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

README.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,26 @@ ProxerConnection.cancel(ProxerTag.NEWS);
107107
```
108108

109109
`ProxerTag` contains tags for all requests.
110+
111+
You can also cancel individual asynchronous requests. Cancelling a single request for the latest
112+
News might look like this:
113+
114+
```java
115+
Request request = new NewsRequest(0).execute(new ProxerRequest.ProxerCallback<NewsResult>() {
116+
@Override
117+
public void onSuccess(NewsResult result) {
118+
119+
}
120+
}, new ProxerRequest.ProxerErrorCallback() {
121+
@Override
122+
public void onError(ProxerErrorResult result) {
123+
124+
}
125+
});
126+
127+
request.cancel();
128+
```
129+
110130
Note: You won't get a result in your request callbacks if you cancel it.
111131

112132
##### Error handling

0 commit comments

Comments
 (0)