Wait between tasks with SingleThreadExecutor
- by Lord.Quackstar
I am trying to (simply) make a blocking thread queue, where when a task is submitted the method waits until its finished executing. The hard part though is the wait.
Here's my 12:30 AM code that I think is overkill:
public void sendMsg(final BotMessage msg) {
try {
Future task;
synchronized(msgQueue) {
task =…