Uploaded image for project: 'Ruby Driver'
  1. Ruby Driver
  2. RUBY-1505

Revise event subscription behavior

    • Type: Icon: Improvement Improvement
    • Resolution: Unresolved
    • Priority: Icon: Minor - P4 Minor - P4
    • None
    • Affects Version/s: None
    • Component/s: None
    • None

      Currently the interactions between event subscription and client instantiation and duplication result in some interesting behavior:

      1. Client#with may reuse or duplicate the cluster in the returned client. If the cluster is reused, so are event subscriptions and attaching events to the new client also adds them to the old client. If a new cluster is created, it does not inherit any of the event subscribers on the original client and instead gets the default subscriber set (if an application explicitly removed those subscribers from the original client, they would reappear in the new client).

      2. Global event subscribers are copied into per-client event subscribers upon client instantiation. Therefore, adding global event subscribers when clients are already instantiated is a silent no-op - these subscribers will not be receiving any events for existing clients.

      3. sdam_proc is currently only applied to the client on which it is specified, not to derived clients via #dup/#with, to be consistent with point 1 above.

      We should think about how to handle the above cases in a sensible and consistent manner.

            Assignee:
            Unassigned Unassigned
            Reporter:
            oleg.pudeyev@mongodb.com Oleg Pudeyev (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: