Documentation

Context

Table of Contents

Namespaces

Internal

Interfaces

Context
Interface for sending messages between execution contexts, such as two coroutines or two processes.
ContextFactory

Classes

ContextException
ContextPanicError
DefaultContextFactory
ProcessContext
ProcessContextFactory
StatusError
ThreadContext
ThreadContextFactory

Functions

startContext()  : Context<TReceive, TSend>
contextFactory()  : ContextFactory
Gets or sets the global context factory.
flattenThrowableBacktrace()  : array<int, FlattenedTraceEntry>
formatFlattenedBacktrace()  : string
flattenArgument()  : string

Functions

startContext()

startContext(string|array<int, string> $script[, Cancellation|null $cancellation = null ]) : Context<TReceive, TSend>
Parameters
$script : string|array<int, string>

Path to PHP script or array with first element as path and following elements as options to the PHP script (e.g.: ['bin/worker', 'Option1Value', 'Option2Value'].

$cancellation : Cancellation|null = null
Tags
template
template
template
Return values
Context<TReceive, TSend>

flattenThrowableBacktrace()

flattenThrowableBacktrace(Throwable $exception) : array<int, FlattenedTraceEntry>
Parameters
$exception : Throwable
Tags
psalm-type

FlattenedTraceEntry = array<non-empty-string, scalar|list>

Return values
array<int, FlattenedTraceEntry>

Serializable exception backtrace, with all function arguments flattened to strings.

formatFlattenedBacktrace()

formatFlattenedBacktrace(array<string|int, mixed> $trace) : string
Parameters
$trace : array<string|int, mixed>

Backtrace produced by flattenThrowableBacktrace().

Return values
string

flattenArgument()

flattenArgument(mixed $value) : string
Parameters
$value : mixed
Return values
string

Serializable string representation of $value for backtraces.


        
On this page

Search results