public function addNotification(string $action, $context = null): self
    {
        $this->notifyHeap[] = new class($action, $context) {
            public $action;
            public $context;
            
            public function __construct($action, $context) {
                $this->action  = $action;
                $this->context = $context;
            }
        };
        
        if (count($this->notifyHeap) === 1) {
            $this->readNotifyHeap();
        }
        
        return $this;
    }
public function addNotification(string $action, $context = null): self
    {
        $this->notifyHeap[] = new class($action, $context) {
            public $action;
            public $context;
            
            public function __construct($action, $context) {
                $this->action  = $action;
                $this->context = $context;
            }
        };
        
        if (count($this->notifyHeap) === 1) {
            $this->readNotifyHeap();
        }
        
        return $this;
    }
public function addNotification ( string $ action , $ context = null ) : self { $ this -> notifyHeap [ ] = new class ( $ action , $ context ) { public $ action ; public $ context ; public function __construct ( $ action , $ context ) { $ this -> action = $ action ; $ this -> context = $ context ; } } ; if ( count ( $ this -> notifyHeap ) === 1 ) { $ this -> readNotifyHeap ( ) ; } return $ this ; }
Add a new notification to the list of notification to send.
If there is only one notification into the list, it will be send now.
Else, a notification is currently sent, so we wait it finish and the
current notification will be sent.

@param string $action The action to send
@param mixed $context (default null) The context to send

@return \BFW\Subject The current instance of this class
Add a new notification to the list of notification to send . If there is only one notification into the list it will be send now . Else a notification is currently sent so we wait it finish and the current notification will be sent .