Skip to content

Commit ff67a38

Browse files
authored
Update README.md
1 parent 40ad723 commit ff67a38

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

README.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,19 @@
108108
mvn test
109109

110110
## 使用样例
111+
如果使用 NettyHttpClient(v3.2.15 版本新增),需要在响应返回后手动调用一下 NettyHttpClient 中的 close 方法,否则进程不会退出。代码示例:
112+
```
113+
...
114+
try {
115+
PushResult result = jpushClient.sendPush(payload);
116+
LOG.info("Got result - " + result);
117+
Thread.sleep(5000);
118+
   // 定义一个 close 方法,最终调用 NettyHttpClient 中的 close 方法即可。
119+
   jpushClient.close();
120+
} catch(InterruptedException e) {
121+
e.printStackTrace();
122+
}
123+
```
111124

112125
### 推送样例
113126

@@ -122,7 +135,7 @@
122135
try {
123136
PushResult result = jpushClient.sendPush(payload);
124137
LOG.info("Got result - " + result);
125-
138+
126139
} catch (APIConnectionException e) {
127140
// Connection error, should retry later
128141
LOG.error("Connection error, should retry later", e);

0 commit comments

Comments
 (0)