Inside'a'task
fetch [x] campaigns / adverts from database
loop rows
fetch access token & other required info from database
perform api call
handle response & save back to db
connection = new AMQPConnection('localhost', 5672, 'guest', 'guest');
$this->channel = $this->connection->channel();
}
public function Queue($queue_name, $content) {
// prevent queue from auto-deleting with all the falses.
$this->channel->queue_declare($queue_name, false, false, false, false);
// pass $queue_name as the routing key
$this->channel->basic_publish(new AMQPMessage($content), '', $queue_name);
}
// …