Add traits to implement all methods of the monitoring interfaces

XMLWordPrintableJSON

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

      Add 3 traits in the library to implement the methods of the 3 monitoring interfaces:

      The methods will have an empty body (no-op).

      Benefit : the developers can write only the method they need instead of having many no-method in their code.

      Trait names:

      • MongoDB\Monitoring\CommandEvents
      • MongoDB\Monitoring\LogEvents
      • MongoDB\Monitoring\SDAMEvents

       

      Usage:

       

      use MongoDB\Driver\Monitoring\CommandSubscriber;
      use MongoDB\Driver\Monitoring\CommandStartedEvent;
      use MongoDB\Monitoring\CommandEvents;
       
      class MyCommandSubscriber
      {
          use CommandEvents;
       
          public commandStarted(CommandStartedEvent $event): void
          {
              // Do stuff for this event only
          }
      }
      

       

       

            Assignee:
            Jérôme Tamarelle
            Reporter:
            Jérôme Tamarelle
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: