Skip to content

Commit

Permalink
fix: add callback function
Browse files Browse the repository at this point in the history
  • Loading branch information
rishtigupta committed Jan 3, 2024
1 parent ad52a0f commit a709eab
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion examples/topic-example.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ function printBanner(string $message, LoggerInterface $logger): void
}

// Wait for a message to be received and logged
while (!file_exists('message_received.flag')) {
$timeout = time() + 60;
while (!file_exists('message_received.flag') && time() < $timeout) {
sleep(1); // Sleep for 1 second before checking again
}

Expand Down

0 comments on commit a709eab

Please sign in to comment.