Restore execution of multiple requests simultaneously

This commit is contained in:
Rohit Awate 2018-07-24 16:22:32 +05:30
parent c739f21337
commit e07c19aee6
2 changed files with 8 additions and 14 deletions

View file

@ -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);
}

View file

@ -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;
}
}