tigase.xmpp.impl

## Class TokenBucketPool.TokenBucket

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

- Enclosing class:
    TokenBucketPool

      public static class TokenBucketPool.TokenBucket
      extends Object

  Single TokenBucket.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `TokenBucket(long rate, long per)` Create Token Bucket.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and 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.

Copyright © 2004–2020 "Tigase, Inc.". All rights reserved.