Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions Parse/src/main/java/com/parse/ParseRequest.java
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,6 @@ private static ThreadPoolExecutor newThreadPoolExecutor(int corePoolSize, int ma
return executor;
}

/**
* This executor should be used for any network operation, in all subclasses.
* Chaining network operations with tasks consumed by Task.BACKGROUND_EXECUTOR , which is smaller,
* will cause performance bottlenecks and possibly lock the whole SDK.
*/
protected static final ExecutorService NETWORK_EXECUTOR = newThreadPoolExecutor(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should also revert to package private?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was never changed.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the future I think it will make sense to move all custom executors (network executor, db executor) to the ParseExecutors class that exists already... but let’s fix this bolts issue first

CORE_POOL_SIZE, MAX_POOL_SIZE, KEEP_ALIVE_TIME, TimeUnit.SECONDS,
new LinkedBlockingQueue<Runnable>(MAX_QUEUE_SIZE), sThreadFactory);
Expand Down Expand Up @@ -151,8 +146,9 @@ public Task<Response> then(Task<Response> task) throws Exception {
}
}
return task;
// Jump off the network executor so this task continuations won't steal network threads
}
}, NETWORK_EXECUTOR);
}, Task.BACKGROUND_EXECUTOR);
}

protected abstract Task<Response> onResponseAsync(ParseHttpResponse response,
Expand Down