Skip to content

Commit f42aa54

Browse files
committed
feat(dispatch): implement executor
1 parent b9c4003 commit f42aa54

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

.idea/gradle.xml

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

library/src/main/java/com/queue/library/Dispatch.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
import java.lang.reflect.Field;
2525
import java.util.concurrent.Callable;
2626
import java.util.concurrent.Exchanger;
27+
import java.util.concurrent.Executor;
2728
import java.util.concurrent.TimeUnit;
2829
import java.util.concurrent.TimeoutException;
2930

@@ -35,7 +36,7 @@
3536
* @date 2019/2/15
3637
* @since 1.0.0
3738
*/
38-
public class Dispatch {
39+
public class Dispatch implements Executor {
3940

4041
private volatile Handler handler = null;
4142
private static final String TAG = Dispatch.class.getSimpleName();
@@ -281,4 +282,9 @@ public boolean quit() {
281282
}
282283
return false;
283284
}
285+
286+
@Override
287+
public void execute(Runnable command) {
288+
postRunnable(command);
289+
}
284290
}

0 commit comments

Comments
 (0)