Skip to content

Commit

Permalink
docs: dedicated executor
Browse files Browse the repository at this point in the history
  • Loading branch information
Krzysztof Borowy authored Jul 24, 2019
1 parent eb4112f commit 3d89711
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
22 changes: 22 additions & 0 deletions docs/advanced/DedicatedExecutor.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Dedicated Thread Executor

Android only feature.
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)

## Motivation

Dedicated thread pool executor makes `AsyncStorage` use separate thread pool for its tasks execution.

Use this feature if `THREAD_POOL_EXECUTOR` from `AsyncTasks`:

- Is used in your app, so that background tasks are queued most of the time
- Acts weird on your device (for example, waits for some time before execution)

## How to use

Add a `AsyncStorage_dedicatedExecutor` property to your `android/gradle.properties`:

```
AsyncStorage_dedicatedExecutor=true
```

3 changes: 3 additions & 0 deletions example/android/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,6 @@

# This is an example of how you can change default DB size (6MB) to 10MB
# AsyncStorage_db_size_in_MB=10

# Enable dedicated thread pool executor
AsyncStorage_dedicatedExecutor=true

0 comments on commit 3d89711

Please sign in to comment.