TeamAmaze / TeamAmaze/AmazeFileManager
Convert all AsyncTasks to Callables called from ReactiveX
Open
Nobody has claimed this yet.
Area-CodeHealth
Issue-Discussion
Issue-Task (low)
- Dominant language
- Kotlin
- Stars
- 6.4k
- Forks
- 1.7k
- Avg merge
- 3d 9h
- Merged PRs (30d)
- 1
Description
public class ReadFileTask extends AsyncTask<Void, Void, ReturnedValueOnReadFile> {
to
public class ReadFileTask implements Callable<ReturnedValueOnReadFile> {
and used as
final ReadFileTask task = new ReadFileTask(getContentResolver(), viewModel.getFile(), getExternalCacheDir(), isRootExplorer());
final Consumer<ReturnedValueOnReadFile> onAsyncTaskFinished = (data) -> {
//operations
}
final Consumer<? super Throwable> onError = error -> {
error.printStackTrace();
}
Flowable.fromCallable(task)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(onAsyncTaskFinished, onError);
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Use the ReadFileTask example and the Flowable.fromCallable entry point as the starting references. Locate the other AsyncTask classes in the project, then verify that each conversion preserves its result and error handling while using the ReactiveX flow shown in the issue. Done means no remaining AsyncTask implementations require conversion.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, java
- Domain
- mobile
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100