Runnable в RequestWorker

This commit is contained in:
Gravit 2018-11-11 16:17:55 +07:00
parent 5c01d5fd17
commit ec6e27ab43
No known key found for this signature in database
GPG key ID: 061981E1E85D3216

View file

@ -1,8 +1,6 @@
package ru.gravit.launcher.client; package ru.gravit.launcher.client;
import javafx.concurrent.Task; import javafx.concurrent.Task;
import ru.gravit.launcher.LauncherAPI;
import ru.gravit.launcher.request.Request;
import ru.gravit.utils.helper.LogHelper; import ru.gravit.utils.helper.LogHelper;
import java.util.concurrent.BlockingQueue; import java.util.concurrent.BlockingQueue;
@ -13,13 +11,13 @@ public RequestWorker()
{ {
queue = new LinkedBlockingQueue<>(64); queue = new LinkedBlockingQueue<>(64);
} }
public BlockingQueue<Task> queue; public BlockingQueue<Runnable> queue;
@Override @Override
public void run() { public void run() {
while (!Thread.interrupted()) while (!Thread.interrupted())
{ {
try { try {
Task task; Runnable task;
task = queue.take(); task = queue.take();
task.run(); task.run();
} catch (InterruptedException e) { } catch (InterruptedException e) {