[infinispan-issues] [JBoss JIRA] (ISPN-9780) compute* implementations for Hot Rod clients

Tristan Tarrant (Jira) issues at jboss.org
Thu Nov 29 09:52:00 EST 2018


Tristan Tarrant created ISPN-9780:
-------------------------------------

             Summary: compute* implementations for Hot Rod clients
                 Key: ISPN-9780
                 URL: https://issues.jboss.org/browse/ISPN-9780
             Project: Infinispan
          Issue Type: Enhancement
          Components: Hot Rod
            Reporter: Tristan Tarrant
             Fix For: 10.0.0.Final


for (; ; ) {
   VersionedValue<V> versioned = cache.getWithMetadata(key);
   if (versioned != null) {
      return versioned.getValue();
   }
   V newValue = f(key);
   if (cache.putIfAbsent(key, newValue)) {
     return newValue;
   }
}
(idea 
computeIfAbsent(userId, Function<K, V> f)
    getOrLock
    If locked > v =  f() then putAndUnlock(userId, v)



--
This message was sent by Atlassian Jira
(v7.12.1#712002)


More information about the infinispan-issues mailing list