Uploaded image for project: 'Commons Lang'
  1. Commons Lang
  2. LANG-1611

Add an initializer which can compare and re-initialize value

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • None
    • None
    • lang.concurrent.*
    • None

    Description

      I would like to have a new class which is similar to AtomicSafeInitializer. But we can compare and re-initialize the value.

      The use case is to refresh access token (e.g. OAuth) when it expires. Multiple threads tries to refresh the same token at the same time, but there should be only one thread to do it, in addition, only the thread which passes the expired token can trigger the initialization.

      Attachments

        Activity

          People

            Unassigned Unassigned
            franzwong Franz Wong
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: