io.vertx.rxjava.core.http

## Class WebSocketStream

- java.lang.Object
- - io.vertx.rxjava.core.http.WebSocketStream

- All Implemented Interfaces:
    ReadStream<WebSocket>, StreamBase

      public class WebSocketStream
      extends Object
      implements ReadStream<WebSocket>

  A stream for `HttpClient` WebSocket connection.

  When the connection attempt is successful, the stream handler is called back with the `WebSocket` argument, immediately followed by a call to the end handler. When the connection attempt fails, the exception handler is invoked.

  The connection occurs when the `handler(io.vertx.core.Handler<io.vertx.rxjava.core.http.WebSocket>)` method is called with a non null handler, the other handlers should be set before setting the handler.

  NOTE: This class has been automatically generated from the `original` non RX-ified interface using Vert.x codegen.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static TypeArg<WebSocketStream>` | `__TYPE_ARG`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `WebSocketStream(WebSocketStream delegate)`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `WebSocketStream` | `endHandler(Handler<Void> endHandler)` Set an end handler.
    `WebSocketStream` | `exceptionHandler(Handler<Throwable> handler)` Set an exception handler on the read stream.
    `WebSocketStream` | `getDelegate()`
    `WebSocketStream` | `handler(Handler<WebSocket> handler)` Set a data handler.
    `static WebSocketStream` | `newInstance(WebSocketStream arg)`
    `WebSocketStream` | `pause()` Pause the `ReadSupport`.
    `WebSocketStream` | `resume()` Resume reading.
    `rx.Observable<WebSocket>` | `toObservable()`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

    - ### Methods inherited from interface io.vertx.rxjava.core.streams.ReadStream

      `newInstance, newInstance`

    - ### Methods inherited from interface io.vertx.rxjava.core.streams.StreamBase

      `newInstance`

- - ### Field Detail

    - #### __TYPE_ARG

          public static final TypeArg<WebSocketStream> __TYPE_ARG

  - ### Constructor Detail

    - #### WebSocketStream

          public WebSocketStream(WebSocketStream delegate)

  - ### Method Detail

    - #### getDelegate

          public WebSocketStream getDelegate()

      Specified by:
        `getDelegate` in interface `ReadStream<WebSocket>`
      Specified by:
        `getDelegate` in interface `StreamBase`

    - #### toObservable

          public rx.Observable<WebSocket> toObservable()

      Specified by:
        `toObservable` in interface `ReadStream<WebSocket>`

    - #### exceptionHandler

          public WebSocketStream exceptionHandler(Handler<Throwable> handler)

      Description copied from interface: `ReadStream`
      Set an exception handler on the read stream.
      Specified by:
        `exceptionHandler` in interface `ReadStream<WebSocket>`
      Specified by:
        `exceptionHandler` in interface `StreamBase`
      Parameters:
        `handler` - the exception handler
      Returns:
        a reference to this, so the API can be used fluently

    - #### handler

          public WebSocketStream handler(Handler<WebSocket> handler)

      Description copied from interface: `ReadStream`
      Set a data handler. As data is read, the handler will be called with the data.
      Specified by:
        `handler` in interface `ReadStream<WebSocket>`
      Returns:
        a reference to this, so the API can be used fluently

    - #### pause

          public WebSocketStream pause()

      Description copied from interface: `ReadStream`
      Pause the `ReadSupport`. While it's paused, no data will be sent to the `dataHandler`
      Specified by:
        `pause` in interface `ReadStream<WebSocket>`
      Returns:
        a reference to this, so the API can be used fluently

    - #### resume

          public WebSocketStream resume()

      Description copied from interface: `ReadStream`
      Resume reading. If the `ReadSupport` has been paused, reading will recommence on it.
      Specified by:
        `resume` in interface `ReadStream<WebSocket>`
      Returns:
        a reference to this, so the API can be used fluently

    - #### endHandler

          public WebSocketStream endHandler(Handler<Void> endHandler)

      Description copied from interface: `ReadStream`
      Set an end handler. Once the stream has ended, and there is no more data to be read, this handler will be called.
      Specified by:
        `endHandler` in interface `ReadStream<WebSocket>`
      Returns:
        a reference to this, so the API can be used fluently

    - #### newInstance

          public static WebSocketStream newInstance(WebSocketStream arg)

Copyright © 2017. All rights reserved.