Class ThreadLimitHandler.Remote

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable
    Enclosing class:
    ThreadLimitHandler

    private final class ThreadLimitHandler.Remote
    extends java.lang.Object
    implements java.io.Closeable
    • Constructor Summary

      Constructors 
      Constructor Description
      Remote​(java.lang.String ip, int limit)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.concurrent.CompletableFuture<java.io.Closeable> acquire()  
      void close()  
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • _ip

        private final java.lang.String _ip
      • _limit

        private final int _limit
      • _locker

        private final Locker _locker
      • _permits

        private int _permits
      • _queue

        private java.util.Deque<java.util.concurrent.CompletableFuture<java.io.Closeable>> _queue
      • _permitted

        private final java.util.concurrent.CompletableFuture<java.io.Closeable> _permitted
    • Constructor Detail

      • Remote

        public Remote​(java.lang.String ip,
                      int limit)
    • Method Detail

      • acquire

        public java.util.concurrent.CompletableFuture<java.io.Closeable> acquire()
      • close

        public void close()
                   throws java.io.IOException
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
        Throws:
        java.io.IOException
      • toString

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