jax-rs-spec
  1. jax-rs-spec
  2. JAX_RS_SPEC-452

Support for WebSockets using java.util.stream.Stream<T> result type and @WebSockets annotation

    Details

    • Type: New Feature New Feature
    • Status: Open
    • Priority: Minor Minor
    • Resolution: Unresolved
    • Affects Version/s: 2.0
    • Fix Version/s: 2.1
    • Component/s: spec
    • Labels:
      None

      Description

      REST over HTTP is client driven and stateless, as is the JAX-RS 2.0 API.

      While this serves rather well for most cases, more and more there is a demand for asynchronous updates to recently received information, particularly using WebSockets. In addition, at time of GA of JAX-RS 2.1, Java SE 8 will be the current platform, with Java EE 8 being the next ambrella spec for JAX-RS. Java SE 8 provides a standard interface for typed asynchronous information streams in the package java.util.stream.

      As WebSockets are simply and compatibly extending HTTP by a natural way to bring asynchronous updates to an HTTP enabled client, Stream<T> is the natural way to deliver the provided updates as Java objects to the receiving party. As a consequence, utilizing WebSockets is the first-class technology to implement asynchronous updates in a RESTful HTTP environment, and Stream<T> is the optimal interface to consume these.

      As a consequence, it just makes sense to support the following combination:

      @WebSockets
      @GET
      public java.util.stream.Stream<T> get() {
      // Asynchronously provide T instances on demand
      }

        Activity

        There are no comments yet on this issue.

          People

          • Assignee:
            Unassigned
            Reporter:
            mkarg
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated: