Class Writer.Reentrant

  • Enclosing interface:
    Writer<L>

    public static final class Writer.Reentrant
    extends Object
    Write reentrants counter
    • Constructor Detail

      • Reentrant

        public Reentrant()
    • Method Detail

      • getMaxReentrants

        public static int getMaxReentrants()
        Returns the maximum number of write() method reentrants a thread is allowed to made. This is related to possible write()->onComplete()->write()->... chain, which may grow infinitely and cause StackOverflow. Using maxWriteReentrants value it's possible to limit such a chain.
        Returns:
        the maximum number of write() method reentrants a thread is allowed to make.
      • get

        public int get()
        Returns the value of the reentrants counter for the current thread.
      • inc

        public boolean inc()
        Increments the reentrants counter by one.
        Returns:
        true if the counter (after incrementing) didn't reach getMaxReentrants() limit, or false otherwise.
      • dec

        public boolean dec()
        Decrements the reentrants counter by one.
        Returns:
        true if the counter (after decrementing) didn't reach getMaxReentrants() limit, or false otherwise.
      • isMaxReentrantsReached

        public boolean isMaxReentrantsReached()
        Returns true, if max number of write->completion-handler reentrants has been reached for the passed Writer.Reentrant object, and next write will happen in the separate thread.
        Returns:
        true, if max number of write->completion-handler reentrants has been reached for the passed Writer.Reentrant object, and next write will happen in the separate thread.