Class JobWorkerRegistry

java.lang.Object
com.bluebell.greenhouse.radicle.services.job.JobWorkerRegistry

@Service public class JobWorkerRegistry extends Object
Tracks claims this application process has accepted, from the moment they are handed to the worker pool until execution ends. Membership is what the heartbeat renews, so a claim is registered before it is submitted rather than once a thread picks it up.
Version:
3.0.6
Author:
Stephen Prizio
  • Constructor Details

    • JobWorkerRegistry

      public JobWorkerRegistry()
  • Method Details

    • register

      public void register(JobClaim claim)
      Registers an accepted claim.
      Parameters:
      claim - accepted claim
    • unregister

      public void unregister(JobClaim claim)
      Removes a finished or rejected claim.
      Parameters:
      claim - claim to remove
    • size

      public int size()
      Returns how many claims this process currently holds.
      Returns:
      accepted claim count
    • snapshot

      public Set<JobClaim> snapshot()
      Returns an immutable accepted-claim snapshot.
      Returns:
      accepted claims