Skip to content

Add priority to QueueFiller #83

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/Callback/src/Callback/Interrupter/QueueFiller.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
use Jaeger\Tracer\Tracer;
use Psr\Log\LoggerInterface;
use ReflectionException;
use ReputationVIP\QueueClient\PriorityHandler\Priority\Priority;
use rollun\callback\Promise\Interfaces\PayloadInterface;
use rollun\callback\Promise\SimplePayload;
use rollun\callback\Queues\Message;
Expand Down Expand Up @@ -69,7 +70,7 @@ public static function unserializeMessage($message)
* @return PayloadInterface
* @throws Exception
*/
public function __invoke($value): PayloadInterface
public function __invoke($value, Priority $priority = null): PayloadInterface
{
$span = $this->tracer->start('QueueFiller::__invoke', [
new StringTag('queue', $this->queue->getName()),
Expand All @@ -84,7 +85,7 @@ public function __invoke($value): PayloadInterface

//fix not found context problem
$this->tracer->flush();
$this->queue->addMessage($message);
$this->queue->addMessage($message, $priority);
$this->logger->info('Add message to queue', [
'message' => $message,
]);
Expand Down