X7ROOT File Manager
Current Path:
/opt/alt/tests/alt-php82-pecl-gearman_2.1.4-1.el8/tests
opt
/
alt
/
tests
/
alt-php82-pecl-gearman_2.1.4-1.el8
/
tests
/
📁
..
📄
connect.inc
(104 B)
📄
gearman_001.phpt
(205 B)
📄
gearman_002.phpt
(277 B)
📄
gearman_client_001.phpt
(492 B)
📄
gearman_client_002.phpt
(503 B)
📄
gearman_client_003.phpt
(459 B)
📄
gearman_client_004.phpt
(487 B)
📄
gearman_client_005.phpt
(544 B)
📄
gearman_client_006.phpt
(1.13 KB)
📄
gearman_client_007.phpt
(1.17 KB)
📄
gearman_client_008.phpt
(1.15 KB)
📄
gearman_client_009.phpt
(477 B)
📄
gearman_client_010.phpt
(1.01 KB)
📄
gearman_client_011.phpt
(957 B)
📄
gearman_client_012.phpt
(1.05 KB)
📄
gearman_client_013.phpt
(652 B)
📄
gearman_client_014.phpt
(634 B)
📄
gearman_client_015.phpt
(929 B)
📄
gearman_client_016.phpt
(1.58 KB)
📄
gearman_client_017.phpt
(1.82 KB)
📄
gearman_client_018.phpt
(2.2 KB)
📄
gearman_client_019.phpt
(673 B)
📄
gearman_client_020.phpt
(2.22 KB)
📄
gearman_client_021.phpt
(2.56 KB)
📄
gearman_client_022.phpt
(306 B)
📄
gearman_client_integration_test_001.phpt
(2.03 KB)
📄
gearman_client_integration_test_002.phpt
(1.3 KB)
📄
gearman_job_001.phpt
(265 B)
📄
gearman_job_002.phpt
(1.33 KB)
📄
gearman_job_003.phpt
(294 B)
📄
gearman_job_integration_test_001.phpt
(1.4 KB)
📄
gearman_job_integration_test_002.phpt
(1.41 KB)
📄
gearman_job_integration_test_003.phpt
(1.39 KB)
📄
gearman_job_integration_test_004.phpt
(1.42 KB)
📄
gearman_job_integration_test_005.phpt
(1.43 KB)
📄
gearman_job_integration_test_006.phpt
(1.38 KB)
📄
gearman_job_integration_test_007.phpt
(1.4 KB)
📄
gearman_job_integration_test_008.phpt
(1.43 KB)
📄
gearman_job_integration_test_009.phpt
(1.41 KB)
📄
gearman_job_integration_test_010.phpt
(1.52 KB)
📄
gearman_task_001.phpt
(806 B)
📄
gearman_task_002.phpt
(931 B)
📄
gearman_task_003.phpt
(1.09 KB)
📄
gearman_task_004.phpt
(2.09 KB)
📄
gearman_task_005.phpt
(1.3 KB)
📄
gearman_task_006.phpt
(301 B)
📄
gearman_tasks_integration_test_001.phpt
(1.94 KB)
📄
gearman_tasks_integration_test_002.phpt
(2.31 KB)
📄
gearman_worker_001.phpt
(474 B)
📄
gearman_worker_002.phpt
(474 B)
📄
gearman_worker_003.phpt
(435 B)
📄
gearman_worker_004.phpt
(444 B)
📄
gearman_worker_005.phpt
(453 B)
📄
gearman_worker_006.phpt
(850 B)
📄
gearman_worker_007.phpt
(848 B)
📄
gearman_worker_008.phpt
(1.2 KB)
📄
gearman_worker_009.phpt
(547 B)
📄
gearman_worker_010.phpt
(1.02 KB)
📄
gearman_worker_011.phpt
(379 B)
📄
gearman_worker_012.phpt
(1.96 KB)
📄
gearman_worker_013.phpt
(826 B)
📄
gearman_worker_014.phpt
(1.32 KB)
📄
gearman_worker_015.phpt
(704 B)
📄
gearman_worker_016.phpt
(1.8 KB)
📄
gearman_worker_017.phpt
(306 B)
📄
gearman_worker_integration_test_001.phpt
(2.14 KB)
📄
skipif.inc
(174 B)
📄
skipifconnect.inc
(396 B)
📄
skipifversion.inc
(248 B)
Editing: gearman_tasks_integration_test_001.phpt
--TEST-- Test Gearman worker methods --SKIPIF-- <?php require_once('skipif.inc'); require_once('skipifconnect.inc'); ?> --FILE-- <?php require_once('connect.inc'); print "Start" . PHP_EOL; $job_name = uniqid(); $pid = pcntl_fork(); if ($pid == -1) { die("Could not fork"); } else if ($pid > 0) { // Parent. This is the worker $worker = new GearmanWorker(); print "addServer: " . var_export($worker->addServer($host, $port), true) . PHP_EOL; print "addFunction: " . var_export( $worker->addFunction( $job_name, function($job) { print "workload: " . var_export($job->workload(), true) . PHP_EOL; } ), true ) . PHP_EOL; for ($i = 0; $i < 6; $i++) { $worker->work(); } print "unregister: " . var_export($worker->unregister($job_name), true) . PHP_EOL; // Wait for child $exit_status = 0; if (pcntl_wait($exit_status) <= 0) { print "pcntl_wait exited with error" . PHP_EOL; } else if (!pcntl_wifexited($exit_status)) { print "child exited with error" . PHP_EOL; } } else { //Child. This is the client. Don't echo anything here $client = new GearmanClient(); if ($client->addServer($host, $port) !== true) { exit(1); // error }; $tasks = []; $tasks[] = $client->addTask($job_name, "normal"); $tasks[] = $client->addTaskBackground($job_name, "normalbg"); $tasks[] = $client->addTaskHigh($job_name, 1); $tasks[] = $client->addTaskHighBackground($job_name, 2.0); $tasks[] = $client->addTaskLow($job_name, "low"); $tasks[] = $client->addTaskLowBackground($job_name, true); $client->runTasks(); if ($client->returnCode() != GEARMAN_SUCCESS) { exit(2); // error } exit(0); } print "Done"; --EXPECTF-- Start addServer: true addFunction: true workload: '2' workload: '1' workload: 'normalbg' workload: 'normal' workload: '1' workload: 'low' unregister: true Done
Upload File
Create Folder