Class AsyncRequestContent

    • Constructor Detail

      • AsyncRequestContent

        public AsyncRequestContent​(java.nio.ByteBuffer... buffers)
      • AsyncRequestContent

        public AsyncRequestContent​(java.lang.String contentType,
                                   java.nio.ByteBuffer... buffers)
    • Method Detail

      • getContentType

        public java.lang.String getContentType()
        Specified by:
        getContentType in interface Request.Content
        the content type string such as "application/octet-stream" or "application/json;charset=UTF8", or null if no content type must be set
      • getLength

        public long getLength()
        Specified by:
        getLength in interface Request.Content
        the content length, if known, or -1 if the content length is unknown
      • subscribe

        public Request.Content.Subscription subscribe​(Request.Content.Consumer consumer,
                                                      boolean emitInitialContent)
        Description copied from interface: Request.Content

        Initializes this content producer with the content consumer, and with the indication of whether initial content, if present, must be emitted upon the initial demand of content (to support delaying the send of the request content in case of Expect: 100-Continue when emitInitialContent is false).

        Specified by:
        subscribe in interface Request.Content
        consumer - the content consumer to invoke when there is demand for content
        emitInitialContent - whether to emit initial content, if present
        the Subscription that links this producer to the consumer
      • fail

        public void fail​(java.lang.Throwable failure)
        Description copied from interface: Request.Content

        Fails this request content, possibly failing and discarding accumulated content that was not demanded.

        The failure may be notified to the consumer at a later time, when the consumer demands for content.

        Typical failure: the request being aborted by user code, or idle timeouts.

        Specified by:
        fail in interface Request.Content
        Specified by:
        fail in interface Request.Content.Subscription
        failure - the reason of the failure
      • offer

        public boolean offer​(java.nio.ByteBuffer buffer)
      • offer

        public boolean offer​(java.nio.ByteBuffer buffer,
                             Callback callback)
      • flush

        public void flush()
      • close

        public void close()
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface
      • isClosed

        public boolean isClosed()
      • toString

        public java.lang.String toString()
        toString in class java.lang.Object