Skip to content

Commit 054699c

Browse files
committed
fix new task and worker files for second php-amqp tutorial
1 parent a345de8 commit 054699c

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

php-amqp/new_task.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,6 @@
3535
$exchange = new AMQPExchange($channel);
3636
$exchange->publish($message, $routing_key);
3737

38-
echo " [x] Sent {$data}", PHP_EOL;
38+
echo " [x] Sent {$message}", PHP_EOL;
3939

4040
$connection->disconnect();

php-amqp/worker.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
$callback_func = function(AMQPEnvelope $message, AMQPQueue $q) use (&$max_jobs) {
1717
echo " [x] Received: ", $message->getBody(), PHP_EOL;
18-
sleep(1);
18+
sleep(sleep(substr_count($message->getBody(), '.')));
1919
echo " [X] Done", PHP_EOL;
2020
$q->ack($message->getDeliveryTag());
2121
};

0 commit comments

Comments
 (0)