Class RedisCaller

java.lang.Object
java.lang.Thread
com.reve.balancemanager.lease.RedisCaller
All Implemented Interfaces:
Runnable

public class RedisCaller extends Thread
This thread will call redis balance increase method whenever required. The reason behind calling this from different thread rather than inside LeaseDTO.getLease(double, LeaseResponse, boolean) method is to reduce the time of returning lease to redis and calling publish method on empty lease. These two method can be called any time after LeaseDTO.getLease(double, LeaseResponse, boolean) method is done.
  • Constructor Details

    • RedisCaller

      public RedisCaller()
      Protected constructor, only to be called from BalanceManager
  • Method Details

    • run

      public void run()
      Thread run method
      Specified by:
      run in interface Runnable
      Overrides:
      run in class Thread
    • savePendingCall

      public void savePendingCall(RedisCallDTO redisCallDTO)
      Save this redisCall in pending call list to be called whenever possible.
      Parameters:
      redisCallDTO - Redis Call to be increased in redis.
    • shutDown

      public void shutDown()
      Shut down this thread.