Uploaded image for project: 'PHP Driver: Library'
  1. PHP Driver: Library
  2. PHPLIB-1528

Add traits to implement all methods of the monitoring interfaces

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

      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:
            jerome.tamarelle@mongodb.com Jérôme Tamarelle
            Reporter:
            jerome.tamarelle@mongodb.com Jérôme Tamarelle
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: