Uploaded image for project: 'REEF'
  1. REEF
  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

            • Assignee:
              motus Sergiy Matusevych
              Reporter:
              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