Skip to content

Commit

Permalink
Add return type to flush function in RdkafkaProducer to be compatible…
Browse files Browse the repository at this point in the history
… to php-rdkafka flush function
  • Loading branch information
felippeduarte committed Aug 8, 2023
1 parent b35bced commit d1dfe04
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions RdKafkaProducer.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,11 +115,11 @@ public function getTimeToLive(): ?int
return null;
}

public function flush(int $timeout): void
public function flush(int $timeout): ?int
{
// Flush method is exposed in phprdkafka 4.0
if (method_exists($this->producer, 'flush')) {
$this->producer->flush($timeout);
return $this->producer->flush($timeout);
}
}
}

0 comments on commit d1dfe04

Please sign in to comment.