public function flush(): void
    {
        if (empty($this->buffers)) {
            return;
        }

        foreach ($this->buffers as $buffer) {
            try {
                $this->sender->sendTo($buffer[0], $buffer[1], $buffer[2]);
            } catch (SenderException $e) {
                if (404 === $e->getCode()) {
                    $this->manager->remove($buffer[0]);
                }
            }
        }

        // WARNING! this will flush every models.
        // Worst case if we have invalid state model and not empty of this.buffers
        // buffers and invalid state models will be flush (eg. in process of none form.isValid())
        $this->manager->flush();
    }
public function flush(): void
    {
        if (empty($this->buffers)) {
            return;
        }

        foreach ($this->buffers as $buffer) {
            try {
                $this->sender->sendTo($buffer[0], $buffer[1], $buffer[2]);
            } catch (SenderException $e) {
                if (404 === $e->getCode()) {
                    $this->manager->remove($buffer[0]);
                }
            }
        }

        // WARNING! this will flush every models.
        // Worst case if we have invalid state model and not empty of this.buffers
        // buffers and invalid state models will be flush (eg. in process of none form.isValid())
        $this->manager->flush();
    }
public function flush ( ) : void { if ( empty ( $ this -> buffers ) ) { return ; } foreach ( $ this -> buffers as $ buffer ) { try { $ this -> sender -> sendTo ( $ buffer [ 0 ] , $ buffer [ 1 ] , $ buffer [ 2 ] ) ; } catch ( SenderException $ e ) { if ( 404 === $ e -> getCode ( ) ) { $ this -> manager -> remove ( $ buffer [ 0 ] ) ; } } } // WARNING! this will flush every models. // Worst case if we have invalid state model and not empty of this.buffers // buffers and invalid state models will be flush (eg. in process of none form.isValid()) $ this -> manager -> flush ( ) ; }
Flush all pushes.
Flush all pushes .