Skip to content
This repository was archived by the owner on Mar 16, 2019. It is now read-only.

Commit cf93077

Browse files
committed
Add Android fs thread
1 parent 19eb220 commit cf93077

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/android/src/main/java/com/RNFetchBlob/RNFetchBlob.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ public class RNFetchBlob extends ReactContextBaseJavaModule {
2121
static ReactApplicationContext RCTContext;
2222
static LinkedBlockingQueue<Runnable> taskQueue = new LinkedBlockingQueue<>();
2323
static ThreadPoolExecutor threadPool = new ThreadPoolExecutor(5, 10, 5000, TimeUnit.MILLISECONDS, taskQueue);
24+
static LinkedBlockingQueue<Runnable> fsTaskQueue = new LinkedBlockingQueue<>();
25+
static ThreadPoolExecutor fsThreadPool = new ThreadPoolExecutor(2, 10, 5000, TimeUnit.MILLISECONDS, taskQueue);
2426

2527
public RNFetchBlob(ReactApplicationContext reactContext) {
2628

@@ -209,7 +211,7 @@ public void run() {
209211
*/
210212
public void readStream(final String path, final String encoding, final int bufferSize, final int tick, final String streamId) {
211213
final ReactApplicationContext ctx = this.getReactApplicationContext();
212-
threadPool.execute(new Runnable() {
214+
fsThreadPool.execute(new Runnable() {
213215
@Override
214216
public void run() {
215217
RNFetchBlobFS fs = new RNFetchBlobFS(ctx);

0 commit comments

Comments
 (0)