TeamAmaze / TeamAmaze/AmazeFileManager

Convert all AsyncTasks to Callables called from ReactiveX

Open
#2,668 3 comments 0 reactions 0 assignees View on GitHub

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.