Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- require_once('email_checker.class.php');
- class Task extends Threaded
- {
- private $value;
- public function __construct(int $i)
- {
- $this->value = $i;
- }
- public function run()
- {
- $file_lines = file('mail.txt');
- $emailChecker = new emailChecker; // Make a new instance
- foreach ($file_lines as $line) {
- $response = $emailChecker->check($line);
- foreach($response as $result) {
- echo $result['query'].'-'.$result['success']."n";
- }
- }
- }
- }
- $file_lines = file('mail.txt');
- # Create a pool of 4 threads
- $pool = new Pool(4);
- for ($i = 0; $i < 15000; ++$i)
- {
- $pool->submit(new Task($i));
- }
- while ($pool->collect());
- $pool->shutdown();
Add Comment
Please, Sign In to add comment