Skip to content

Commit

Permalink
v1.0.9
Browse files Browse the repository at this point in the history
  • Loading branch information
albert-lii committed Sep 8, 2017
1 parent 950133b commit ab3bca1
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions sutils/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ android {
defaultConfig {
minSdkVersion 9
targetSdkVersion 25
versionCode 7
versionName "1.0.7"
versionCode 9
versionName "1.0.9"

testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public <T> void sendRequest(int what, Object cancelsign, Request<T> request, OnR
*
* @return
*/
public void checkRequestQueue() {
private void checkRequestQueue() {
if (mRequestQueue == null) {
// 设置五个并发,此处可以传入并发数量。
mRequestQueue = NoHttp.newRequestQueue(5);
Expand Down Expand Up @@ -64,9 +64,26 @@ public void cancelAll() {
/**
* 停止所有请求
*/
public void stopAll() {
public void stopQueue() {
checkRequestQueue();
// 完全退出app时,调用这个方法释放CPU。
mRequestQueue.stop();
}

/**
* 恢复请求队列
*/
public void startQueue() {
checkRequestQueue();
mRequestQueue.start();
}

/**
* 获取请求队列
*
* @return
*/
public RequestQueue getRequestQueue() {
return mRequestQueue;
}
}

0 comments on commit ab3bca1

Please sign in to comment.