Uploaded image for project: 'Spring Data Redis'
  1. Spring Data Redis
  2. DATAREDIS-650

Support for setting setIfAbsent with timeout in RedisTemplate

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: Minor
    • Resolution: Duplicate
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
    • Sprint:
      Lovelace RC1

      Description

      RedisConnection already provides the following method that corresponds to Redis SET command (https://redis.io/commands/set):

      void set(byte[] key, byte[] value, Expiration expiration, SetOption option)
      

      Unfortunately, there does not seem to be a similar method in RedisTemplate and for instance creating a lock with a single command does not seem to be possible. Would you please consider extending the ValueOperations class and providing the respective method? E.g.

      Boolean setIfAbsent(K key, V value, long timeout, TimeUnit unit);
      

      Cheers

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                mp911de Mark Paluch
                Reporter:
                ppiastucki Piotr Piastucki
                Last updater:
                Mark Paluch
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: