From e07c19aee63fb4c4215656d44a7f8f448a0eac67 Mon Sep 17 00:00:00 2001 From: Rohit Awate Date: Tue, 24 Jul 2018 16:22:32 +0530 Subject: [PATCH] Restore execution of multiple requests simultaneously --- .../everest/controllers/DashboardController.java | 6 ------ .../controllers/state/DashboardState.java | 16 ++++++++-------- 2 files changed, 8 insertions(+), 14 deletions(-) diff --git a/src/main/java/com/rohitawate/everest/controllers/DashboardController.java b/src/main/java/com/rohitawate/everest/controllers/DashboardController.java index 96a33f8..3eb60ac 100644 --- a/src/main/java/com/rohitawate/everest/controllers/DashboardController.java +++ b/src/main/java/com/rohitawate/everest/controllers/DashboardController.java @@ -202,11 +202,6 @@ public class DashboardController implements Initializable { @FXML void sendRequest() { - if (requestManager != null && requestManager.isRunning()) { - snackbar.show("Please wait while the current request is processed.", 5000); - return; - } - if (responseBox.getChildren().size() == 2) { responseBox.getChildren().remove(0); responseArea.clear(); @@ -504,7 +499,6 @@ public class DashboardController implements Initializable { @FXML private void clearResponseArea() { - responseBox.getChildren().remove(0); responseArea.clear(); showLayer(ResponseLayer.PROMPT); } diff --git a/src/main/java/com/rohitawate/everest/controllers/state/DashboardState.java b/src/main/java/com/rohitawate/everest/controllers/state/DashboardState.java index 8762d09..5b6c3d3 100644 --- a/src/main/java/com/rohitawate/everest/controllers/state/DashboardState.java +++ b/src/main/java/com/rohitawate/everest/controllers/state/DashboardState.java @@ -51,9 +51,9 @@ public class DashboardState { // ResponseLayer parameters private RequestManager requestManager; - public void setRequestManager(RequestManager manager) { this.requestManager = manager; + requestManager.removeEventHandler(WorkerStateEvent.WORKER_STATE_RUNNING, requestManager.getOnRunning()); requestManager.removeEventHandler(WorkerStateEvent.WORKER_STATE_SUCCEEDED, requestManager.getOnSucceeded()); requestManager.removeEventHandler(WorkerStateEvent.WORKER_STATE_FAILED, requestManager.getOnFailed()); @@ -78,13 +78,6 @@ public class DashboardState { response.getHeaders().forEach((key, value) -> responseHeaders.put(key, value.get(0))); } - public DashboardState() { - } - - public DashboardState(ComposerState composer) { - this.composer = composer; - } - private void onRequestFailed(Event e) { this.visibleLayer = ResponseLayer.ERROR; Throwable throwable = requestManager.getException(); @@ -124,4 +117,11 @@ public class DashboardState { requestManager.reset(); } + + public DashboardState() { + } + + public DashboardState(ComposerState composer) { + this.composer = composer; + } }