Package one.nio.http

Class EventSourceResponse

    • Field Detail

      • eventSource

        private EventSource<java.lang.String> eventSource
    • Constructor Detail

      • EventSourceResponse

        public EventSourceResponse​(java.lang.String resultCode)
    • Method Detail

      • poll

        public EventSource.Event<java.lang.String> poll()
                                                 throws java.io.IOException,
                                                        HttpException
        Description copied from interface: EventSource
        Waits for the next SSE and returns an event. The method can block for a long time ( determined by server ). It is essential to check for null and EventSource.Event.isEmpty() before processing
        Specified by:
        poll in interface EventSource<java.lang.String>
        Returns:
        the next event from the stream or null, if stream was closed by either party
        Throws:
        java.io.IOException - an I/O exception occurred
        HttpException - an incorrect HTTP request received
      • setEventSource

        void setEventSource​(EventSource<java.lang.String> es)
      • close

        public void close()
                   throws java.io.IOException
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
        Throws:
        java.io.IOException