Skip to content
forked from ares333/php-curl

This is undoubtedly the best php curl class in the world.It is widely used by many developers.

Notifications You must be signed in to change notification settings

xonge/CurlMulti

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 

Repository files navigation

CurlMulti

This is undoubtedly the best php curl library in the world.It is widely used by many developers.The library is a wrapper of curl_multi_* functions with best performance,maximum flexibility,maximum ease of use and negligible performance consumption.

Mechanism

Without pthreads php is single-threaded language,so the library widely use callbacks.There are only two common functions CurlMulti::add() and CurlMulti::start().add() just add a task to internal taskpool.start() starts callback cycle with the concurrent number of CurlMulti::$maxThread and is blocked until all added tasks(a typical task is a url) are finished.If you have huge number of tasks you will use CurlMulti::$cbTask to specify a callback function to add() urls,this callback is called when the number of running concurrent is less than CurlMulti::$maxThread.When a task finished the 'process callback' specified in add() is immediately called,and then fetch a task from internal taskpool,and then add the task to the running concurrent.When all added tasks finished the start() finished.

Usage

About

This is undoubtedly the best php curl class in the world.It is widely used by many developers.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • PHP 100.0%