
- PHP Tutorial
- PHP - Home
- PHP - Introduction
- PHP - Environment Setup
- PHP - Syntax Overview
- PHP - Variable Types
- PHP - Constants
- PHP - Operator Types
- PHP - Decision Making
- PHP - Loop Types
- PHP - Arrays
- PHP - Strings
- PHP - Web Concepts
- PHP - GET & POST
- PHP - File Inclusion
- PHP - Files & I/O
- PHP - Functions
- PHP - Cookies
- PHP - Sessions
- PHP - Sending Emails
- PHP - File Uploading
- PHP - Coding Standard
- Advanced PHP
- PHP - Predefined Variables
- PHP - Regular Expression
- PHP - Error Handling
- PHP - Bugs Debugging
- PHP - Date & Time
- PHP & MySQL
- PHP & AJAX
- PHP & XML
- PHP - Object Oriented
- PHP - For C Developers
- PHP - For PERL Developers
- PHP Form Examples
- PHP - Form Introduction
- PHP - Validation Example
- PHP - Complete Form
- PHP login Examples
- PHP - Login Example
- PHP - Facebook Login
- PHP - Paypal Integration
- PHP - MySQL Login
- PHP AJAX Examples
- PHP - AJAX Search
- PHP - AJAX XML Parser
- PHP - AJAX Auto Complete Search
- PHP - AJAX RSS Feed Example
- PHP XML Example
- PHP - XML Introduction
- PHP - Simple XML
- PHP - Simple XML GET
- PHP - SAX Parser Example
- PHP - DOM Parser Example
- PHP Frame Works
- PHP - Frame Works
- PHP - Core PHP vs Frame Works
- PHP Design Patterns
- PHP - Design Patterns
- PHP Function Reference
- PHP - Built-In Functions
- PHP Useful Resources
- PHP - Questions & Answers
- PHP - Useful Resources
- PHP - Discussion
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
PHP - Worker Functions
Worker class
The Worker Threads have a persistent context as such should be used over Threads in most cases.
Whenever a Worker class started, the run method can be executed. But the Thread class can't leave until one of the following conditions met −
- Worker goes out of scope (no more references remain)
- Programmer calls shutdown
- Script dies
It means that a programmer can reuse the context throughout execution. Placing objects on the stack of Worker can cause the Worker to execute the stacked objects run method.
Class synopsis
Worker extends Thread implements Traversable , Countable , ArrayAccess { /* Methods */ public int collect ([ Callable $collector ] ) public int getStacked ( void ) public bool isShutdown ( void ) public boolean isWorking ( void ) public bool shutdown ( void ) public int stack ( Threaded &$work ) public int unstack ( void ) /* Inherited methods */ public void Thread::detach ( void ) public integer Thread::getCreatorId ( void ) public static Thread Thread::getCurrentThread ( void ) public static integer Thread::getCurrentThreadId ( void ) public integer Thread::getThreadId ( void ) public static mixed Thread::globally ( void ) public boolean Thread::isJoined ( void ) public boolean Thread::isStarted ( void ) public boolean Thread::join ( void ) public void Thread::kill ( void ) public boolean Thread::start ([ integer $options ] ) }
Sr.No | Function & Description |
---|---|
1 |
Function can collect references to completed tasks. |
2 |
Function can get the remaining stack size. |
3 |
Function can tell if a referenced Worker has been shutdown. |
4 |
Function can can tell if Worker is executing Stackables. |
5 |
Function can shutdown the Worker after executing all Stackables previously stacked. |
6 |
Function can return new length of a stack. |
php_function_reference.htm
Advertisements