Class LeaseHealthCheck

java.lang.Object
org.apache.pekko.coordination.lease.LeaseHealthCheck
All Implemented Interfaces:
scala.Function0<scala.concurrent.Future<Object>>

public class LeaseHealthCheck extends Object implements scala.Function0<scala.concurrent.Future<Object>>
Performs a lease health check by attempting to acquire and immediately release a test lease.

Once the first check succeeds, subsequent checks return true without contacting the API. This is a quick connectivity test to verify the lease API is accessible.

Returns true if: - Lease is successfully acquired (true) - Lease cannot be acquired due to conflict (another owner has it, but the API is reachable) (false)

Returns false if: - Any exception occurs (LeaseException, AskTimeoutException, etc.)

Since:
2.0.0
  • Constructor Details

    • LeaseHealthCheck

      public LeaseHealthCheck(ActorSystem system, String leaseProviderName)
  • Method Details

    • apply

      public scala.concurrent.Future<Object> apply()
      Specified by:
      apply in interface scala.Function0<scala.concurrent.Future<Object>>
    • check

      public scala.concurrent.Future<Object> check()
    • lease

      protected Lease lease()