Package tigase.xmpp.impl

## Class TokenBucketPool.TokenBucket

- java.lang.Object
- - tigase.xmpp.impl.TokenBucketPool.TokenBucket

- Enclosing class:
    TokenBucketPool

      public static class TokenBucketPool.TokenBucket
      extends java.lang.Object

  Single TokenBucket.

- - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `TokenBucket​(long rate, long per)` | Create Token Bucket.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `boolean` | `consume()` | Consume token if available.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### TokenBucket

          public TokenBucket​(long rate,
                             long per)

      Create Token Bucket.
      Parameters:
        `rate` - amount of available tokens
        `per` - per nanosecond!

  - ### Method Detail

    - #### consume

          public boolean consume()

      Consume token if available.
      Returns:
        `true` if token was available.