ThreadPool¶
-
php\lang\ThreadPool
Class ThreadPool
Methods
__construct
()¶private
isScheduled
()¶Is Scheduled ?
Returns: bool
isShutdown
()¶Is Shutdown?
Returns: bool
isTerminated
()¶
Returns: bool
execute
($runnable, $env = null)¶Execute some $runnable via the Executor Service
Parameters:
- $runnable – callable
- $env – php\lang\Environment
submit
($runnable, $env = null)¶
Parameters:
- $runnable – callable
- $env – php\lang\Environment
Returns:
schedule
($runnable, $delay, $env = null)¶
Parameters:
- $runnable – callable
- $delay – int
- $env – php\lang\Environment
Returns:
shutdown
()¶
shutdownNow
()¶
awaitTermination
($timeout)¶Blocks until all tasks have completed execution after a shutdown request, or the timeout occurs, or the current thread is interrupted, whichever happens first.
throws php\lang\\Exception
Parameters:
- $timeout – int - - in milliseconds
Returns: bool
- static
create
($coreSize, $maxSize, $keepAliveTime = 0)¶
Parameters:
- $coreSize – int - the number of threads to keep in the pool, even if they are idle
- $maxSize – int - the maximum number of threads to allow in the pool
- $keepAliveTime – int - in millis
Returns:
- static
createFixed
($max)¶
Parameters:
- $max – int
Returns:
- static
createCached
¶
Returns: php\lang\ThreadPool
- static
createSingle
¶Creates an Executor that uses a single worker thread operating off an unbounded queue.
Returns: php\lang\ThreadPool
- static
createScheduled
($corePoolSize)¶Creates a thread pool that can schedule commands to run after a given delay, or to execute periodically.
Parameters:
- $corePoolSize – int
Returns: