I'm using this process to send pushes , so all this depends on control Messaged Id.
What i thought about is how can i run this process with each id in the same time.
Example :
$RedyToSend=[12,23,34,45,...] //List of Control Message Id's
I want to make the process like this: (i don't know if it's possible)
For Every id:
Dispatcher(12);
Dispatcher(23);
.
.
.
etc..
This is the code that i am using, i am thinking about getting it out from the main, put it into another function() then call it with providing it a different Control Message ID in the same time.
public function main(){
$readyToSend = $this-> controlMessageDAO-> getPendingToSend();
if(is_array($readyToSend)) {
foreach($readyToSend as $controlMessage)
{
$controlMessageId = $controlMessage["control_message_id"];
$this-> saveLog("Ready to send control message " . $controlMessageId);
$maxInsertId = $this-> messageLogInsertDAO-> getMaxId($controlMessageId);
$this-> handleControlMessage($controlMessageId);
$this-> handlePlatformData($this-> controlMessageVO);
$recipients = $this-> messageLogInsertDAO-> getRecipients($controlMessageId, $maxInsertId);
$this-> messageLogInsertDAO-> updateMessageLogInsertStatus($maxInsertId, $controlMessageId);
$this-> handleRecipients($this-> controlMessageVO, $recipients);
}
}