Uploaded image for project: 'RESTEasy'
  1. RESTEasy
  2. RESTEASY-1816

OnComplete callback registered via SseEventSource.register() is not called

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Major
    • 3.5.1.Final, 4.0.0.Beta3
    • 3.5.0.CR1
    • None
    • None

    Description

      SseEventSource has option to specify onComplete callback

      Javadoc says "onComplete callback is invoked when there are no further events to be received."

      Example:

      SseEventSource msgEventSource = SseEventSource.target(target).build();
              try (SseEventSource eventSource = msgEventSource) {
                  eventSource.register(event -> {
                      // actions on event, this is called
                  }, ex -> {
                      // actions on error, this is called
                  }, () -> {
                      completed.incrementAndGet(); // This is never called
                  });
                  eventSource.open();
              }
      

      SseEventSourceImpl creates ArrayList to for onComplete callbacks, adds onComplete callback to it, but there is no code to run it.

      Test: https://github.com/resteasy/Resteasy/pull/1433/files#diff-46bd7bf2136ed3b55bf449e8b0a9ee77R121

      Attachments

        Issue Links

          Activity

            People

              rnetuka@redhat.com Radovan Netuka
              kanovotn Katerina Odabasi (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: