Extension of javafx.concurrent.Service to support polling

XMLWordPrintable

    • Type: Enhancement
    • Resolution: Duplicate
    • Priority: P4
    • 8
    • Affects Version/s: fx2.1
    • Component/s: javafx
    • Environment:

      All

      To implement a periodic execution of Tasks you have currently to manually restart a service with registering a listener:

      Service<...> service;

       service.stateProperty().addListener(new ChangeListener<Worker.State>() {
                  public void changed(ObservableValue<? extends Worker.State> observable, Worker.State oldState, Worker.State newState) {
                      if (newState.equals(Worker.State.SUCCEEDED) || newState.equals(Worker.State.FAILED)) {
                          service.reset();
                          service.start();
                      }
                  }

              });


      An out-of-the-box support for polling in javafx.concurrent.Service is appreciated: long-pooling of RESTful services is a common practice for the implementation of server push.

            Assignee:
            Richard Bair (Inactive)
            Reporter:
            Adam Bien (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: