Skip to content

Commit 3d89711

Browse files
author
Krzysztof Borowy
authored
docs: dedicated executor
1 parent eb4112f commit 3d89711

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed

docs/advanced/DedicatedExecutor.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Dedicated Thread Executor
2+
3+
Android only feature.
4+
Would be mostly used in brownfield apps and [in edge cases with some android devices.](https://github.com/react-native-community/async-storage/issues/159)
5+
6+
## Motivation
7+
8+
Dedicated thread pool executor makes `AsyncStorage` use separate thread pool for its tasks execution.
9+
10+
Use this feature if `THREAD_POOL_EXECUTOR` from `AsyncTasks`:
11+
12+
- Is used in your app, so that background tasks are queued most of the time
13+
- Acts weird on your device (for example, waits for some time before execution)
14+
15+
## How to use
16+
17+
Add a `AsyncStorage_dedicatedExecutor` property to your `android/gradle.properties`:
18+
19+
```
20+
AsyncStorage_dedicatedExecutor=true
21+
```
22+

example/android/gradle.properties

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,6 @@
1919

2020
# This is an example of how you can change default DB size (6MB) to 10MB
2121
# AsyncStorage_db_size_in_MB=10
22+
23+
# Enable dedicated thread pool executor
24+
AsyncStorage_dedicatedExecutor=true

0 commit comments

Comments
 (0)