ThreadPool

php\lang\ThreadPool

Class ThreadPool

Methods


__construct()

private

isScheduled()

Is Scheduled ?

Результат:bool
isShutdown()

Is Shutdown?

Результат:bool
isTerminated()
Результат:bool
execute($runnable, $env = null)

Execute some $runnable via the Executor Service

Параметры:
submit($runnable, $env = null)
Параметры:
Результат:

php\concurrent\Future

schedule($runnable, $delay, $env = null)
Параметры:
Результат:

php\concurrent\Future

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

Параметры:
  • $timeoutint - - in milliseconds
Результат:

bool

static create($coreSize, $maxSize, $keepAliveTime = 0)
Параметры:
  • $coreSizeint - the number of threads to keep in the pool, even if they are idle
  • $maxSizeint - the maximum number of threads to allow in the pool
  • $keepAliveTimeint - in millis
Результат:

php\lang\ThreadPool

static createFixed($max)
Параметры:
  • $maxint
Результат:

php\lang\ThreadPool

static createCached
Результат:php\lang\ThreadPool
static createSingle

Creates an Executor that uses a single worker thread operating off an unbounded queue.

Результат:php\lang\ThreadPool
static createScheduled($corePoolSize)

Creates a thread pool that can schedule commands to run after a given delay, or to execute periodically.

Параметры:
  • $corePoolSizeint
Результат:

php\lang\ThreadPool