Menu
Reference
- Manticore\Ds
- Async
- Classes
- AggregateError
- CancellationToken
- CancelledException
- Channel
- ChannelClosedException
- Context
- DeadlockException
- Mutex
- Once
- Pool
- Received
- SelectCase
- Selected
- Semaphore
- Settled
- Task
- TaskGroup
- TimeoutException
- Functions
- async()
- awaitAll()
- awaitAllSettled()
- awaitAny()
- channel()
- delay()
- dump()
- dumpOn()
- failure()
- group()
- mapConcurrent()
- mapSettled()
- readFile()
- select()
- selectNow()
- selectWithin()
- shield()
- shutdownOn()
- spawn()
- stats()
- timeout()
- watchdog()
- writeFile()
- Http
- Http\WebSocket
- Buffer
- Process
- Io\Poll
- Manticore\Sapi
- Ffi
watchdog()
function
function watchdog(float $milliseconds): void
Name any task that holds the loop longer than $milliseconds.
When a task runs that long without suspending, a line naming it is written to STDERR. 0 turns it off. MANTICORE_ASYNC_WATCHDOG=<ms> does the same without touching the program. A cooperative loop cannot preempt, so the report necessarily comes after the stall; it catches the otherwise invisible causes: a CPU-bound stretch with no suspend point, a blocking call, a library falling back to blocking I/O. Each task reports its first breach and then only a doubling, so a CPU-heavy worker does not flood the log.
async: watchdog - task #4 "report" at app.php:88 held the loop 214.3 ms (limit 50 ms)Parameters
$millisecondsfloat- the threshold; 0 or less turns the watchdog off