Class SerializeExecutionsByKey<K>

java.lang.Object
org.keycloak.models.sessions.infinispan.changes.SerializeExecutionsByKey<K>

public class SerializeExecutionsByKey<K> extends Object
Adding an in-JVM lock to prevent a best-effort concurrent executions for the same ID. This should prevent a burst of requests by letting only the first request pass, and then the others will follow one-by-one. Use this when the code wrapped by runSerialized is known to produce conflicts when run concurrently with the same ID.
Author:
Alexander Schwartz
  • Constructor Details

    • SerializeExecutionsByKey

      public SerializeExecutionsByKey()
  • Method Details

    • runSerialized

      public void runSerialized(K key, Runnable task)