You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I saw a few questions about similar situation but nothing really helped me for now, so I'm asking my own situations.
I'm in a api-platform context and I want to add RecurringMessages after a resource is created to make background work on it.
I have a Processor used on a Post Operation, and after the $this->persistProcessor->process() call, I want to create a RecurringMessage with the objectId.
The RecurringMessageHandler will fetch the object from the db, fetch datas from a 3rd party and update the object.
Once the object change its status to a given status (from the 3rd party), the RecurringMessage will be removed from the Scheduler.
I'm running the scheduler consummer with php bin/console messenger:consume scheduler_object -vvv.
When I call my POST object, nothing is happening on the consummer.
I guess it's because it's 2 differents process, so the RecurringMessages the web call is adding are not known by the cli consummer ?
The question is how should I run the consummer in that situation ? If I run it from the web call it will be a child process of the webcall, so the consummer will be temrinated when the webcall is ending.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I saw a few questions about similar situation but nothing really helped me for now, so I'm asking my own situations.
I'm in a api-platform context and I want to add
RecurringMessage
s after a resource is created to make background work on it.I have a
Processor
used on a PostOperation
, and after the$this->persistProcessor->process()
call, I want to create aRecurringMessage
with the objectId.The
RecurringMessageHandler
will fetch the object from the db, fetch datas from a 3rd party and update the object.Once the object change its status to a given status (from the 3rd party), the
RecurringMessage
will be removed from theScheduler
.Here what I tried:
In the
Processor
The Task
The Scheduler
and The TaskHandler
I'm running the scheduler consummer with
php bin/console messenger:consume scheduler_object -vvv
.When I call my POST object, nothing is happening on the consummer.
I guess it's because it's 2 differents process, so the
RecurringMessage
s the web call is adding are not known by the cli consummer ?The question is how should I run the consummer in that situation ? If I run it from the web call it will be a child process of the webcall, so the consummer will be temrinated when the webcall is ending.
Beta Was this translation helpful? Give feedback.
All reactions