Class BufferRef

    • Constructor Detail

      • BufferRef

        public BufferRef​(Send<Buffer> send)
        Create a reference that holds the exclusive ownership of the sent buffer.
        send - The sent buffer to take ownership of.
    • Method Detail

      • replace

        public void replace​(Send<Buffer> send)
        Replace the underlying referenced buffer with the given buffer.

        Note: this method closes the current buffer, and takes exclusive ownership of the received buffer.

        The buffer assignment is performed using a volatile store.

        send - The Send with the new Buffer instance that is replacing the currently held buffer.
      • content

        public Buffer content()
        Access the buffer in this reference.
        The buffer held by the reference.