Heim  >  Artikel  >  Backend-Entwicklung  >  php多线程问题

php多线程问题

WBOY
WBOYOriginal
2016-06-06 20:25:081282Durchsuche

微信支付中的企业支付用php的程序调用给同一个openid打钱的时候有频率限制,大概在1分钟左右,腾讯说用双线程就不会有限制了

回复内容:

微信支付中的企业支付用php的程序调用给同一个openid打钱的时候有频率限制,大概在1分钟左右,腾讯说用双线程就不会有限制了

用 PHP 创建一个线程就可以了呀。

<code>class cthread extends Thread {
     public function run() {
       // 一些耗时的任务
     }
}
$t = new cthread();
t->start(); // 启动线程,立即执行下一句
// to do other things
</code>

}

Stellungnahme:
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn