- class
ThreadPool
(php\lang\ThreadPool
) - package
std
- source
php/lang/ThreadPool.php
Description
Class ThreadPool
ThreadPool ::
create()
ThreadPool ::
createFixed()
ThreadPool ::
createCached()
ThreadPool ::
createSingle()
- Creates an Executor that uses a single worker thread operatingThreadPool ::
createScheduled()
- Creates a thread pool that can schedule commands to run after a
->
__construct()
- internal->
isScheduled()
- Is Scheduled ?->
isShutdown()
- Is Shutdown?->
isTerminated()
->
execute()
- Execute some $runnable via the Executor Service->
submit()
->
schedule()
->
shutdown()
- Initiates an orderly shutdown in which previously submitted->
shutdownNow()
- Attempts to stop all actively executing tasks, halts the->
awaitTermination()
- Blocks until all tasks have completed execution after a shutdown->
getActiveCount()
- Returns the approximate number of threads that are actively->
getTaskCount()
- Returns the approximate total number of tasks that have ever been
ThreadPool::create(int $coreSize, int $maxSize, int $keepAliveTime): ThreadPool
ThreadPool::createFixed(int $max): ThreadPool
ThreadPool::createCached(): ThreadPool
ThreadPool::createSingle(): ThreadPool
Creates an Executor that uses a single worker thread operating off an unbounded queue.
ThreadPool::createScheduled(int $corePoolSize): ThreadPool
Creates a thread pool that can schedule commands to run after a given delay, or to execute periodically.
__construct(): void
internal
isScheduled(): bool
Is Scheduled ?
isShutdown(): bool
Is Shutdown?
isTerminated(): bool
execute(callable $runnable, php\lang\Environment $env): void
Execute some $runnable via the Executor Service
submit(callable $runnable, php\lang\Environment $env): Future
schedule(callable $runnable, int $delay, php\lang\Environment $env): Future
shutdown(): void
Initiates an orderly shutdown in which previously submitted tasks are executed, but no new tasks will be accepted.
shutdownNow(): void
Attempts to stop all actively executing tasks, halts the processing of waiting tasks
awaitTermination(int $timeout): bool
Blocks until all tasks have completed execution after a shutdown request, or the timeout occurs, or the current thread is interrupted, whichever happens first.
getActiveCount(): int
Returns the approximate number of threads that are actively executing tasks.
getTaskCount(): int|null
Returns the approximate total number of tasks that have ever been scheduled for execution. Because the states of tasks and threads may change dynamically during computation, the returned value is only an approximation.