diff --git a/src/Client.php b/src/Client.php index d6a79da..4667604 100644 --- a/src/Client.php +++ b/src/Client.php @@ -276,7 +276,7 @@ public function process(null|int|float $timeout = 0, bool $reply = true, bool $c if ($now >= $max) { return null; } - return $this->process($max - $now); + return $this->process($max - $now, $reply, $checkTimeout); case 'PONG': $this->logger?->debug('receive ' . $line); diff --git a/tests/Functional/StreamTest.php b/tests/Functional/StreamTest.php index 323c7c3..ac5b4ab 100644 --- a/tests/Functional/StreamTest.php +++ b/tests/Functional/StreamTest.php @@ -17,6 +17,24 @@ class StreamTest extends FunctionalTestCase private bool $empty; + public function testConsumerExpiration() + { + $client = $this->createClient(['timeout' => 0.1, 'delay' => 0.1]); + $stream = $client->getApi()->getStream('empty'); + $stream->getConfiguration() + ->setSubjects(['empty']); + + $stream->create(); + $consumer = $stream->getConsumer('empty')->create(); + $consumer->getConfiguration()->setSubjectFilter('empty'); + + $info = $client->info; + + $consumer->setIterations(1)->setExpires(3)->handle(function () { + }); + $this->assertSame($info, $client->info); + } + public function testDeduplication() { $stream = $this->getClient()->getApi()->getStream('tester');