Skip to content

Instantly share code, notes, and snippets.

@amitshekhariitbhu
Last active July 10, 2016 17:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save amitshekhariitbhu/bacc9dcb936e5f14327ec4f3a8e16302 to your computer and use it in GitHub Desktop.
Save amitshekhariitbhu/bacc9dcb936e5f14327ec4f3a8e16302 to your computer and use it in GitHub Desktop.
/*
* 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