You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hopefully you're open to being asked questions in the issues? Really enjoying this library, but I'm trying to figure out how to gracefully deal with when the remote client disconnects, rather than the following exception:
java.lang.IllegalStateException: Response has already been written
at io.vertx.core.http.impl.HttpServerResponseImpl.checkWritten(HttpServerResponseImpl.java:588)
at io.vertx.core.http.impl.HttpServerResponseImpl.write(HttpServerResponseImpl.java:613)
at io.vertx.core.http.impl.HttpServerResponseImpl.write(HttpServerResponseImpl.java:296)
at io.vertx.core.http.impl.HttpServerResponseImpl.write(HttpServerResponseImpl.java:55)
at io.vertx.ext.web.handler.sse.impl.SSEConnectionImpl.writeHeader(SSEConnectionImpl.java:143)
at io.vertx.ext.web.handler.sse.impl.SSEConnectionImpl.withHeader(SSEConnectionImpl.java:131)
at io.vertx.ext.web.handler.sse.impl.SSEConnectionImpl.id(SSEConnectionImpl.java:101)
at uk.ashleybye.rxweb.verticles.ApiVerticle$testSse$1$1.accept(ApiVerticle.kt:71)
at uk.ashleybye.rxweb.verticles.ApiVerticle$testSse$1$1.accept(ApiVerticle.kt:20)
at io.reactivex.internal.observers.LambdaObserver.onNext(LambdaObserver.java:60)
at io.reactivex.internal.operators.observable.ObservableObserveOn$ObserveOnObserver.drainNormal(ObservableObserveOn.java:200)
at io.reactivex.internal.operators.observable.ObservableObserveOn$ObserveOnObserver.run(ObservableObserveOn.java:252)
at io.reactivex.internal.schedulers.ScheduledRunnable.run(ScheduledRunnable.java:61)
at io.reactivex.internal.schedulers.ScheduledRunnable.call(ScheduledRunnable.java:52)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:748)
I can't figure out from the tests how you're going about it. Perhaps I should use EventSource rather than just push data from the Observable directly? But that still seems like it would not affect the client connection.
Anyway, this is my rather noddy test example (excuse Kotlin vice Java, but it should be reasonably clear what's going on):
Simply because in these few lines of codes, it tries to close a connection that has already been closed by the client, hence the IllegalStateException.
But I'd need to reproduce the issue, in Java, without any fancy Observable involved. If you have time to do so, that'd be awesome, else I'll try to check by myself when I have the time.
For the lastId stuff, same thing, I'd need to reproduce the issue in an unit test to give it a proper look.
it's the last id the client has received. If the client wants to reconnect to get the missing events, it has to reconnect with it. Otherwise, the client will get the current event and in this case, the lastEventId is null.
Hopefully you're open to being asked questions in the issues? Really enjoying this library, but I'm trying to figure out how to gracefully deal with when the remote client disconnects, rather than the following exception:
I can't figure out from the tests how you're going about it. Perhaps I should use
EventSource
rather than just push data from the Observable directly? But that still seems like it would not affect the client connection.Anyway, this is my rather noddy test example (excuse Kotlin vice Java, but it should be reasonably clear what's going on):
As an aside (probably another question really), why does
connection.id(...)
send the details to the client? And why doeslastId()
return null?The text was updated successfully, but these errors were encountered: