Skip to content

Commit

Permalink
[#859]:Allow SseEventSink.close() to throw IOException
Browse files Browse the repository at this point in the history
  • Loading branch information
jimma committed Sep 7, 2022
1 parent ba7b9cd commit ca898df
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,8 @@ public void startDomain(@PathParam("id") final String id,
sseEventSink.close();
} catch (final InterruptedException e) {
e.printStackTrace();
} catch (IOException ioe) {
//handle I/O error
}
});
}
Expand Down
5 changes: 4 additions & 1 deletion jaxrs-api/src/main/java/jakarta/ws/rs/sse/SseEventSink.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

package jakarta.ws.rs.sse;

import java.io.IOException;
import java.util.concurrent.CompletionStage;

/**
Expand Down Expand Up @@ -71,7 +72,9 @@ public interface SseEventSink extends AutoCloseable {
* <p>
* Subsequent calls have no effect and are ignored. Once the {@link SseEventSink} is closed, invoking any method other
* than this one and {@link #isClosed()} would result in an {@link IllegalStateException} being thrown.
*
* @exception IOException if an I/O error occurs.
*/
@Override
void close();
void close() throws IOException;
}

0 comments on commit ca898df

Please sign in to comment.