import jalview.gui.AlignViewport;
import jalview.viewmodel.AlignmentViewport;
import jalview.ws.params.ParamDatastoreI;
+import jalview.ws2.actions.PollingTaskExecutor;
import jalview.ws2.actions.api.JobI;
import jalview.ws2.actions.api.TaskEventListener;
import jalview.ws2.api.Credentials;
return null;
})
.when(listener).taskCompleted(any(), any());
- action.perform(viewport, List.of(), Credentials.empty(), listener);
+ var executor = PollingTaskExecutor.fromPool(viewport.getServiceExecutor());
+ var task = action.createTask(viewport, List.of(), Credentials.empty());
+ task.addTaskEventListener(listener);
+ var cancellable = executor.submit(task);
try
{
latch.await(100, TimeUnit.MILLISECONDS);
} catch (InterruptedException e)
{
+ cancellable.cancel(true);
}
return listener;
}