Can you just queue the firing of the function and then when that queue job fires run the loop?
awestrope said:
Can you just queue the firing of the function and then when that queue job fires run the loop?
That seems redundant. What I'd like to do is something like this:
for ($i = 0; $i < 1000; $i++) {
Queue::add("message");
}
Queue::pushAll("queue_name");
where pushAll() would use native driver's bulk/batch API (I know IronMQ and SQS has it, not sure about the others) or use foreach loop to push each message if driver has no bulk/batch API.
For now I think I'll just use native client like this:
Queue::getIron()->postMessages("queue_name", $messages);
and work on more elegant solution when I have some free time.
super late reply, but how did you create the $messages array?
I can't find a way to create the individual payloads
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community