Skip to content

Instantly share code, notes, and snippets.

@wangerekaharun
Created December 11, 2019 11:14
Show Gist options
  • Select an option

  • Save wangerekaharun/d150812acd35325f0ec43537ff7d9aa4 to your computer and use it in GitHub Desktop.

Select an option

Save wangerekaharun/d150812acd35325f0ec43537ff7d9aa4 to your computer and use it in GitHub Desktop.
public class PreviousRideRepo {
// define a new executor of type single thread
private Executor executor= Executors.newSingleThreadExecutor();
private void insert(){
executor.execute(()->{
// do your insert here inside this block
requestsDao.savePreviousRequests(requestList);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment