Class ProxyChannelRingBuffer

    • Constructor Detail

      • ProxyChannelRingBuffer

        public ProxyChannelRingBuffer()
    • Method Detail

      • writeAcquire

        protected abstract long writeAcquire()
        Acquire an offset to write to. If there's no space available a wait strategy may be used.
        Returns:
        the offset that was acquired for writing or EOF
      • writeRelease

        protected abstract void writeRelease​(long offset,
                                             int callTypeId)
        Ordered store of the callTypeId for the message at offset
        Parameters:
        offset - the offset that was released for writing
        callTypeId - A unique ID for the call
      • readAcquire

        protected abstract long readAcquire()
        Acquire an offset to read from
        Returns:
        the offset that was acquired for reading or EOF
      • readRelease

        protected abstract void readRelease​(long offset)
        Release the offset from reading
        Parameters:
        offset - the offset to release for reading
      • consumerReferenceArrayIndex

        protected abstract long consumerReferenceArrayIndex​(long offset)
        Get the position index of the consumer in the reference array
        Parameters:
        offset - the current offset of the consumer returned from readAcquire()
        Returns:
        the consumer index
      • producerReferenceArrayIndex

        protected abstract long producerReferenceArrayIndex​(long offset)
        Get the position index of the producer in the reference array
        Parameters:
        offset - the current offset of the producer returned from writeAcquire()
        Returns:
        the producer index
      • writeReference

        protected abstract void writeReference​(long index,
                                               Object reference)
        Write a reference into the index of the reference array.
        Parameters:
        index - the index to write to
        reference - the reference to write
      • readReference

        protected abstract Object readReference​(long index)
        Read a reference from the index of the reference array.
        Parameters:
        index - the index to read from
        Returns:
        the reference that was read