Skip to content

Instantly share code, notes, and snippets.

@lwahlmeier
Created January 30, 2018 22:51
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 lwahlmeier/6a887e4ee6abb3b4429e397f147988cf to your computer and use it in GitHub Desktop.
Save lwahlmeier/6a887e4ee6abb3b4429e397f147988cf to your computer and use it in GitHub Desktop.
protected void callReader(boolean onClientThread) {
final Runnable localReaderCaller = this.readerCaller;
if (readerCaller != null) {
if (onClientThread) {
readerCaller.run();
} else {
getClientsThreadExecutor().execute(()->{
if(localReaderCaller == readerCaller) {
readerCaller.run();
}
});
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment