Last active
July 10, 2016 17:10
-
-
Save amitshekhariitbhu/bacc9dcb936e5f14327ec4f3a8e16302 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Using it for Background Tasks | |
*/ | |
public void doSomeBackgroundWork(){ | |
DefaultExecutorSupplier.getInstance().forBackgroundTasks() | |
.execute(new Runnable() { | |
@Override | |
public void run() { | |
// do some background work here. | |
} | |
}); | |
} | |
/* | |
* Using it for Light-Weight Background Tasks | |
*/ | |
public void doSomeLightWeightBackgroundWork(){ | |
DefaultExecutorSupplier.getInstance().forLightWeightBackgroundTasks() | |
.execute(new Runnable() { | |
@Override | |
public void run() { | |
// do some light-weight background work here. | |
} | |
}); | |
} | |
/* | |
* Using it for MainThread Tasks | |
*/ | |
public void doSomeMainThreadWork(){ | |
DefaultExecutorSupplier.getInstance().forMainThreadTasks() | |
.execute(new Runnable() { | |
@Override | |
public void run() { | |
// do some Main Thread work here. | |
} | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment