Uploaded image for project: 'REEF (Retired)'
  1. REEF (Retired)
  2. REEF-1561 REEF as a library
  3. REEF-1545

Refactor HandlerContainer to improve safety, readability, and performance

    XMLWordPrintableJSON

Details

    Description

      Current implementation of HandlerContainer class has several issues:

      • It uses the Subscription class in untyped fashion, ignoring its type parameter.
      • .unsubscribe() method manually checks for all possible types of the subscription token, even though it is always known at the subscription time. This is error-prone and hard to read.
      • When registering handlers, we use a sequence of two operations - Map.putIfAbsent() and .replace(), instead of just .put(). It also introduces a potential race condition, since the map is synchronized.

      Attachments

        Activity

          People

            motus Sergiy Matusevych
            motus Sergiy Matusevych
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - 48h
                48h
                Remaining:
                Remaining Estimate - 48h
                48h
                Logged:
                Time Spent - Not Specified
                Not Specified