Skip to content

Commit 4cbdecf

Browse files
author
Devendra
committed
adding windowing support to java
1 parent bb37031 commit 4cbdecf

36 files changed

Lines changed: 177 additions & 58 deletions

‎android/Pubnub-Android-3.5.5.jar‎

232 Bytes
Binary file not shown.
327 Bytes
Binary file not shown.
232 Bytes
Binary file not shown.
232 Bytes
Binary file not shown.
227 Bytes
Binary file not shown.
372 Bytes
Binary file not shown.
428 Bytes
Binary file not shown.

‎codenameone/src/com/pubnub/api/SubscribeWorker.java‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@ class SubscribeWorker extends AbstractSubscribeWorker {
1313
maxRetries, retryInterval, headers);
1414
}
1515

16+
SubscribeWorker(Vector _requestQueue, int connectionTimeout,
17+
int requestTimeout, int maxRetries, int retryInterval, int windowInterval, Hashtable headers) {
18+
super(_requestQueue, connectionTimeout, requestTimeout,
19+
maxRetries, retryInterval, windowInterval, headers);
20+
}
1621
void process(HttpRequest hreq) {
1722
HttpResponse hresp = null;
1823
int currentRetryAttempt = (hreq.isDar())?1:maxRetries;
@@ -24,6 +29,12 @@ void process(HttpRequest hreq) {
2429
return;
2530
}
2631
}
32+
if (!hreq.isSubzero() && windowInterval != 0) {
33+
try {
34+
Thread.sleep(windowInterval);
35+
} catch (InterruptedException e) {
36+
}
37+
}
2738
hreq.setWorker(this);
2839
while (!_die && currentRetryAttempt <= maxRetries) {
2940
try {

‎j2me/Pubnub-MicroEdition-3.5.5.jar‎

221 Bytes
Binary file not shown.

‎j2me/src1/com/pubnub/api/SubscribeWorker.java‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,23 @@ class SubscribeWorker extends AbstractSubscribeWorker {
1313
maxRetries, retryInterval, headers);
1414
}
1515

16+
SubscribeWorker(Vector _requestQueue, int connectionTimeout,
17+
int requestTimeout, int maxRetries, int retryInterval, int windowInterval, Hashtable headers) {
18+
super(_requestQueue, connectionTimeout, requestTimeout,
19+
maxRetries, retryInterval, windowInterval, headers);
20+
}
21+
1622
void process(HttpRequest hreq) {
1723
HttpResponse hresp = null;
1824
int currentRetryAttempt = (hreq.isDar())?1:maxRetries;
1925
log.verbose("disconnectAndResubscribe is " + hreq.isDar());
2026
boolean sleep = false;
27+
if (!hreq.isSubzero() && windowInterval != 0) {
28+
try {
29+
Thread.sleep(windowInterval);
30+
} catch (InterruptedException e) {
31+
}
32+
}
2133
while (!_die && currentRetryAttempt <= maxRetries) {
2234
if (sleep) {
2335
try {

0 commit comments

Comments
 (0)