public function pushAll()
    {
        /** @var \robocloud\Message\RoboMessage[] $chunk */
        foreach (array_chunk($this->buffer, self::KINESIS_MAX_PUT_RECORDS_COUNT) as $chunk) {
            try {
                $this->putRecords($chunk);
            } catch (\Exception $e) {
                $this->processError($e, $chunk);
            }
        }

        // Empty the buffer.
        $this->buffer = [];
    }