current location: Home > download site > Library download > Other libraries > Beanstalkd PHP library
Beanstalkd PHP library
Classify: Library download / Other libraries | Release time: 2017-12-12 | visits: 1114 |
Download: 54 |
Latest Downloads
Fantasy Aquarium
Girls Frontline
Wings of Stars
Little Flower Fairy Fairy Paradise
Restaurant Cute Story
Shanhe Travel Exploration
Love and Producer
The most powerful brain 3
Odd Dust: Damila
Young Journey to the West 2
24 HoursReading Leaderboard
- 1 How to Populate an HTML Dropdown List with Data from a MySQL Database?
- 2 dvwssr.dll - What is dvwssr.dll?
- 3 How to Concatenate C Strings on a Single Line?
- 4 How Can We Handle Idle MySQL Connections?
- 5 How to Handle Authentication Cookies for HTTP Requests in Go?
- 6 What is cloud mining?
- 7 How to Troubleshoot "Can't Connect to MySQL Server" Errors When Connecting Remotely via Command Line? .
- 8 Why Can't I Update a Table Inside a Trigger That's Modifying the Same Table in MySQL?
- 9 How to Extract Multi-Line Text from HTML with JavaScript Regex?
- 10 Python Functions and Modules: Writing Reusable Code Like a Pro
- 11 Block Mayhem codes for November 2024
- 12 How Can C Programmers Develop Powerful Browser Plugins with NPAPI?
- 13 How can I run my Go application with administrator privileges without manual UAC elevation?
- 14 Can I Use XPath with BeautifulSoup?
- 15 How to Convert Integers to Strings in PHP: Which Method Is Best?
Latest Tutorials
-
- Go language practical GraphQL
- 1993 2024-04-19
-
- 550W fan master learns JavaScript from scratch step by step
- 3411 2024-04-18
-
- Getting Started with MySQL (Teacher mosh)
- 1797 2024-04-07
-
- Mock.js | Axios.js | Json | Ajax--Ten days of quality class
- 2612 2024-03-29
Beanstalk, a high-performance, lightweight distributed memory queue system, was originally designed to reduce the page access delay of high-capacity web application systems by asynchronously executing time-consuming tasks in the background. It has supported 9.5 million User's Facebook Causes application.
Later open sourced, PostRank is now deployed and used on a large scale, processing millions of tasks every day. Beanstalkd is a typical Memcached-like design. The protocol and usage are the same, so users who have used memcached will feel that Beanstalkd looks familiar.
High performance cannot be separated from asynchronous, and asynchronous cannot be separated from queues, and internally they are the principles of the Producer-Comsumer model.
Beanstalkd’s PHP client library
#!/usr/bin/env php <?php define('BASE_DIR', realpath(__DIR__.'/..')); define('PHAR_FILENAME', 'pheanstalk.phar'); define('PHAR_FULLPATH', BASE_DIR.'/'.PHAR_FILENAME); // ---------------------------------------- reexecute_if_phar_readonly($argv); delete_existing_pheanstalk_phar(); build_pheanstalk_phar(); verify_pheanstalk_phar(); exit(0); // ---------------------------------------- // See: http://www.php.net/manual/en/phar.configuration.php#ini.phar.readonly function reexecute_if_phar_readonly($argv) { if (ini_get('phar.readonly') && !in_array('--ignore-readonly', $argv)) { $command = sprintf( 'php -d phar.readonly=0 %s --ignore-readonly', implode($argv, ' ') ); echo "Phar configured readonly in php.ini; attempting to re-execute:\n"; echo "$command\n"; passthru($command, $exitStatus); exit($exitStatus); } } function delete_existing_pheanstalk_phar() { if (file_exists(PHAR_FULLPATH)) { printf("- Deleting existing %s\n", PHAR_FILENAME); unlink(PHAR_FULLPATH); } } function build_pheanstalk_phar() { printf("- Building %s from %s\n", PHAR_FILENAME, BASE_DIR); $phar = new Phar(PHAR_FULLPATH); $phar->buildFromDirectory(BASE_DIR); $phar->setStub( $phar->createDefaultStub('vendor/autoload.php') ); } function verify_pheanstalk_phar() { $phar = new Phar(PHAR_FULLPATH); printf("- %s built with %d files.\n", PHAR_FILENAME, $phar->count()); }