Uploaded image for project: 'Infinispan'
  1. Infinispan
  2. ISPN-12937

Expiring counters

    XMLWordPrintable

Details

    • Enhancement
    • Resolution: Done
    • Major
    • 13.0.0.C2
    • None
    • Clustered Counter
    • None

    Description

      Example use case:

      If I want to create a limit of 10 >requests per minute, I create a counter with a TTL of 1 minute and with an initial value of 10. Each time someone makes a request that affects this limit, the counter is decremented and the request is authorized as long as the value is > 0. When it is 0, the request is considered to be limited and is rejected until the key expires. When the key has expired and the next request arrives, the same TTL and initial value is recreated.
      

      We have already bounded counter which throws an Exception when the boundary is reached. We just need to add TTL to the cache entry.

      Attachments

        Activity

          People

            pruivo@redhat.com Pedro Ruivo
            pruivo@redhat.com Pedro Ruivo
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: