Package one.nio.http

Interface EventSource<D>

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Interface Description
      static interface  EventSource.Event<D>
      A single Server Sent Event, received from peer.
    • Method Detail

      • poll

        EventSource.Event<D> poll()
                           throws java.io.IOException,
                                  HttpException
        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
        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