I am making a plugin and the particular code is using an ExecutorService so it does not freeze the main thread. The only problem is it is still happening. Does anyone know why this is happening?
Code:
I thought calling the get method on a Future is supposed to run in a different thread.
Code:
Code:
double price;
ExecutorService service = Executors.newSingleThreadExecutor();
try {
price = service.submit(() -> manager.getValue(args[1], 1)).get();
} catch (InterruptedException | ExecutionException e) {
e.printStackTrace();
sendError(sender);
return false;
}
I thought calling the get method on a Future is supposed to run in a different thread.
Last edited:
