|
|
|
|
21
|
static ReactApplicationContext RCTContext;
|
21
|
static ReactApplicationContext RCTContext;
|
22
|
static LinkedBlockingQueue<Runnable> taskQueue = new LinkedBlockingQueue<>();
|
22
|
static LinkedBlockingQueue<Runnable> taskQueue = new LinkedBlockingQueue<>();
|
23
|
static ThreadPoolExecutor threadPool = new ThreadPoolExecutor(5, 10, 5000, TimeUnit.MILLISECONDS, taskQueue);
|
23
|
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);
|
24
|
|
26
|
|
25
|
public RNFetchBlob(ReactApplicationContext reactContext) {
|
27
|
public RNFetchBlob(ReactApplicationContext reactContext) {
|
26
|
|
28
|
|
|
|
|
|
209
|
*/
|
211
|
*/
|
210
|
public void readStream(final String path, final String encoding, final int bufferSize, final int tick, final String streamId) {
|
212
|
public void readStream(final String path, final String encoding, final int bufferSize, final int tick, final String streamId) {
|
211
|
final ReactApplicationContext ctx = this.getReactApplicationContext();
|
213
|
final ReactApplicationContext ctx = this.getReactApplicationContext();
|
212
|
- threadPool.execute(new Runnable() {
|
|
|
|
|
214
|
+ fsThreadPool.execute(new Runnable() {
|
213
|
@Override
|
215
|
@Override
|
214
|
public void run() {
|
216
|
public void run() {
|
215
|
RNFetchBlobFS fs = new RNFetchBlobFS(ctx);
|
217
|
RNFetchBlobFS fs = new RNFetchBlobFS(ctx);
|