26 lines
626 B
PHP
26 lines
626 B
PHP
<?php
|
|
|
|
namespace app\queue\redis;
|
|
|
|
use app\event\GoogleAdsCustomers;
|
|
use app\event\GoogleAdsDateDatas;
|
|
use Webman\Event\Event;
|
|
use Webman\RedisQueue\Consumer;
|
|
|
|
class GoogleAdsDateDataQueue implements Consumer
|
|
{
|
|
// 要消费的队列名
|
|
public $queue = GoogleAdsDateDatas::queue;
|
|
|
|
// 连接名,对应 plugin/webman/redis-queue/redis.php 里的连接`
|
|
public $connection = 'default';
|
|
|
|
// 消费
|
|
public function consume($data)
|
|
{
|
|
// dump($this->queue.' consumed',$data);
|
|
Event::emit(GoogleAdsDateDatas::queue, $data);
|
|
Event::emit(GoogleAdsCustomers::last_sync, $data);
|
|
}
|
|
|
|
} |