web-msg-sender里怎么使用Timer

maltose

老哥,官方文档上说Timer怎么放在Oxx方法里,但是我现在只会使用web-msg-sender里的这个发送方法?
public function push()
{
$data = [
'type' => 'publish',
'content' => json_encode($this->content),
'to' => $this->to_user
];
$ch = curl_init ();
curl_setopt($ch, CURLOPT_URL, $this->push_api_url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Expect:'));
$res = curl_exec($ch);
curl_close($ch);
dump($res);
}
我现在怎么将Timer加入进去,我没有找到一个使用这个的实例代码,你能帮助我吗?

1831 0 0
0个回答

年代过于久远,无法发表回答
🔝