Index
Classes
Every class, interface, exception, trait and enum, A to Z, with the topic it belongs to. Type to filter; methods appear when you filter.
53 symbols
A#
AggregateException– More than one thing failed in one run(): what $fn threw and the failures of coroutines nobody awaited, or several of those. CoroutinesAggregateException::__construct– Wraps $exceptions, which run() does when it has more than one failure to report. CoroutinesAggregateException::contains– Whether one of the failures is an instance of $class (subclasses and implementations included). CoroutinesAggregateException::getExceptions– Returns the failures, all of them or those of one class. Coroutines
B#
BufferedStream– A seekable PSR-7 stream for a body that is still being produced, kept in memory and then in a temporary file. Streams and filesBufferedStream::__construct– Creates an empty stream. Streams and filesBufferedStream::__toString– Returns the content from the start, or a message starting with "Stream Error" when that fails. Streams and filesBufferedStream::append– Adds $chunk to the end of the stream, without waiting for a reader. Streams and filesBufferedStream::close– Waits for end(), then closes the stream. Streams and filesBufferedStream::detach– Waits for end(), then returns the content as a file resource and marks the stream detached. Streams and filesBufferedStream::end– Declares that nothing more will be appended, which fixes the size of the stream. Streams and filesBufferedStream::eof– Returns true if the stream is at the end of the stream. Streams and filesBufferedStream::getContents– Waits for end(), then returns the remaining content. Streams and filesBufferedStream::getMetadata– Get stream metadata as an associative array or retrieve a specific key. Streams and filesBufferedStream::getSize– Returns the size of the content, once end() has been called: it waits until then. Streams and filesBufferedStream::isReadable– Returns whether or not the stream is readable. Streams and filesBufferedStream::isSeekable– Returns whether or not the stream is seekable. Streams and filesBufferedStream::isWritable– Returns whether or not the stream is writable. Streams and filesBufferedStream::read– Returns up to $length bytes, waiting while the content is not yet appended and the stream has not ended. Streams and filesBufferedStream::rewind– Seek to the beginning of the stream. Streams and filesBufferedStream::seek– Seek to a position in the stream. Streams and filesBufferedStream::tell– Returns the current position of the file read/write pointer Streams and filesBufferedStream::write– Write data to the stream. Streams and files
C#
CancelledException– Thrown in a coroutine whose wait was cancelled: with phasync::cancel(), or with its frame (Frame::cancel(), the frame's deadline, a deadlock). Cancellation and cleanupChannelException– A channel operation failed: it was written to after it was closed, or the wait looked like a deadlock. Channels and messagingClientException– A request failed for a reason that is neither an invalid request nor a network failure. HTTP clientConsole– Terminal output from markup: styled on a terminal, plain text when piped to a file, and laid out the same way in both. Console and loggingConsoleLogger– A PSR-3 logger writing Console::log() lines: to a terminal styled, piped plain. Console and loggingCurlAwaiter– Runs cURL handles cooperatively, so other coroutines run while a request is in flight. Blocking calls and the extensionCurlMulti– The old name of CurlAwaiter.CurlResponse– The PSR-7 response of an HttpClient request, filled in by a cURL transfer. HTTP clientClientException::__construct– An exception about $request, which ClientException::getRequest returns. HTTP clientClientException::getRequest– Return the request that failed. HTTP clientConsole::__construct– Creates a console writing to $stream. Console and loggingConsole::columns– The terminal's width in columns: $COLUMNS, else 80. Console and loggingConsole::cut– $markup cut to at most $width columns, ending with $ellipsis when anything was cut; the styles still open are closed. Console and loggingConsole::escape– $text made safe to embed in markup: shown as it is. Console and loggingConsole::hasColor– Returns whether this console writes styled output. Console and loggingConsole::log– Writes a log line, in one format everywhere. Console and loggingConsole::pad– Returns $markup padded with $pad to $width columns. Console and loggingConsole::render– $markup as this console writes it: styled, or plain. Console and loggingConsole::strip– $markup as plain text, laid out. Console and loggingConsole::width– The columns $markup takes on a terminal. Console and loggingConsole::write– Writes $markup to the stream, styled or plain as the console is. Console and loggingConsoleLogger::__construct– Creates a logger. Console and loggingConsoleLogger::alert– Action must be taken immediately. Console and loggingConsoleLogger::critical– Critical conditions. Console and loggingConsoleLogger::debug– Detailed debug information. Console and loggingConsoleLogger::emergency– System is unusable. Console and loggingConsoleLogger::error– Runtime errors that do not require immediate action but should typically be logged and monitored. Console and loggingConsoleLogger::info– Interesting events. Console and loggingConsoleLogger::log– Logs with an arbitrary level. Console and loggingConsoleLogger::notice– Normal but significant events. Console and loggingConsoleLogger::warning– Exceptional occurrences that are not errors. Console and loggingCurlAwaiter::await– Runs $ch to completion and returns its body, without blocking other coroutines. Blocking calls and the extensionCurlMulti::await–CurlResponse::getBody– Return the body stream, without waiting for the transfer. HTTP clientCurlResponse::getDownloadedBytes– Return the number of bytes downloaded so far, or null before cURL has reported any progress. HTTP clientCurlResponse::getDownloadSize– Return the number of bytes cURL expects to download, or null before cURL has reported it. HTTP clientCurlResponse::getHeader– Retrieves a message header value by the given case-insensitive name. HTTP clientCurlResponse::getHeaderLine– Return the values of a header joined by ", ", or an empty string; the name is case-insensitive. HTTP clientCurlResponse::getHeaders– Retrieves all message header values. HTTP clientCurlResponse::getProtocolVersion– Retrieves the HTTP protocol version as a string. HTTP clientCurlResponse::getReasonPhrase– Gets the response reason phrase associated with the status code. HTTP clientCurlResponse::getStatusCode– Return the HTTP status code, waiting for the headers to arrive. HTTP clientCurlResponse::getUploaded– Return the number of bytes uploaded so far, or null before cURL has reported any progress. HTTP clientCurlResponse::getUploadSize– Return the number of bytes cURL expects to upload, or null before cURL has reported it. HTTP clientCurlResponse::hasHeader– Checks if a header exists by the given case-insensitive name. HTTP clientCurlResponse::withAddedHeader– Return an instance with the specified header appended with the given value. HTTP clientCurlResponse::withBody– Return an instance with the specified message body. HTTP clientCurlResponse::withHeader– Return an instance with the provided value replacing the specified header. HTTP clientCurlResponse::withoutHeader– Return an instance without the specified header. HTTP clientCurlResponse::withProtocolVersion– Return an instance with the specified HTTP protocol version. HTTP clientCurlResponse::withStatus– Return an instance with the specified status code and, optionally, reason phrase. HTTP client
D#
DeadlockException– Coroutines wait, and nothing can ever wake them: the outermost run() throws this. The event loopDeadmanException– The writer of a StringBuffer exited without ending it: a read throws this once the buffered data is read. Streams and files
E#
Event– A list of listeners that are called when the event is triggered. Coordination and limitsEvent::hasListeners– Returns true if any listener is registered, with listen() or once(). Coordination and limitsEvent::listen– Calls $listeners every time the event triggers. Coordination and limitsEvent::off– Removes $listeners, whether they were added with listen() or once(). Coordination and limitsEvent::once– Calls $listeners the next time the event triggers, and not after. Coordination and limitsEvent::trigger– Calls the listeners with $args, then the once() listeners, which are forgotten after that. Coordination and limits
F#
Frame– The lifetime of a phasync::run() call: the coroutines started inside it, which it waits for, cancels and rethrows. Scopes and framesFrame::cancel– Cancels every coroutine of the frame, and of the frames nested in it, with a CancelledException. Scopes and framesFrame::isCancellationRequested– Whether the frame, or a frame it is nested in, was asked to stop. Scopes and framesFrame::requestCancellation– Asks the coroutines of the frame, and of the frames nested in it, to stop, without an exception: sets the flag Frame::isCancellationRequested reads. Scopes and framesFrame::setExceptionHandler– Sends the failures of the frame's coroutines that nobody awaited to $handler, one by one, instead of having run() throw them. Scopes and framesFrame::setTimeout– Cancels the frame when $seconds have passed, and makes its run() throw a TimeoutException instead of the cancellation. Scopes and frames
H#
HttpClient– A PSR-18 HTTP client that runs concurrent requests on curl_multi. HTTP clientHttpClientOptions– The options of an HTTP request, as public properties that map to cURL options. HTTP clientHttpClient::__construct– Create a client whose options are the defaults for every request it sends. HTTP clientHttpClient::addMiddlewareFunction– Wrap HttpClient::sendRequest in a function that can change the request or the response. HTTP clientHttpClient::get– Send a GET request. HTTP clientHttpClient::post– Send a POST request with a body. HTTP clientHttpClient::put– Send a PUT request with a body. HTTP clientHttpClient::request– Send a request with any method, a body and options for this request only. HTTP clientHttpClient::sendAsyncRequest– Send a PSR-7 request without waiting: the lazy counterpart of HttpClient::sendRequest. HTTP clientHttpClient::sendRequest– Send a PSR-7 request with the client's default options. HTTP clientHttpClientOptions::__construct– Create the options from an array of values keyed by property name. HTTP clientHttpClientOptions::overrideFrom– Return a copy of this instance with the non-null values of $options applied on top. HTTP client
I#
IOException– A stream wait failed: the value was no stream, the stream was closed while waited for, or polling failed. Waiting and timeouts
L#
LockInterface– An object that runs a closure while holding a lock that other coroutines wait for. Coordination and limitsLockTrait– Implements LockInterface: a lock that is reentrant for the coroutine holding it and fair for the others. Coordination and limitsLruCache– A bounded in-memory cache that forgets the least recently used entries first. Resource managementLockInterface::lock– Runs $callable while holding the lock of this object, and returns what it returns. Coordination and limitsLockTrait::lock– Runs $callable while holding the lock of this object, and returns what it returns. Coordination and limitsLruCache::__construct– Creates an empty cache. Resource managementLruCache::bytes– The bytes held, when $maxBytes is set. Resource managementLruCache::clear– Removes every entry. Resource managementLruCache::count– The entries held, expired ones not yet dropped included. Resource managementLruCache::delete– Whether there was an entry for $key. Resource managementLruCache::get– Returns the value stored under $key, and makes it the most recently used. Resource managementLruCache::has– Returns whether there is an entry for $key, and makes it the most recently used if there is. Resource managementLruCache::set– Stores $value under $key, making room as needed. Resource management
M#
MultipartStream– A multipart/form-data request body built from a nested array of fields. Streams and filesMultipartStreamInterface– A request body stream that carries a multipart/form-data payload. Streams and filesMySQLiAwaiter– Waits for a mysqli asynchronous query without blocking other coroutines. Blocking calls and the extensionMySQLiPoll– The old name of MySQLiAwaiter.MultipartStream::__construct– Create the body from the fields. Streams and filesMultipartStream::__toString– Reads all data from the stream into a string, from the beginning to end. Streams and filesMultipartStream::close– Closes the stream and any underlying resources. Streams and filesMultipartStream::detach– Separates any underlying resources from the stream. Streams and filesMultipartStream::eof– Returns true if the stream is at the end of the stream. Streams and filesMultipartStream::getContents– Returns the remaining contents in a string Streams and filesMultipartStream::getContentType– Return the Content-Type header value, multipart/form-data with this body's boundary. Streams and filesMultipartStream::getMetadata– Get stream metadata as an associative array or retrieve a specific key. Streams and filesMultipartStream::getSize– Get the size of the stream if known. Streams and filesMultipartStream::isReadable– Returns whether or not the stream is readable. Streams and filesMultipartStream::isSeekable– Returns whether or not the stream is seekable. Streams and filesMultipartStream::isWritable– Returns whether or not the stream is writable. Streams and filesMultipartStream::read– Read data from the stream. Streams and filesMultipartStream::rewind– Seek to the beginning of the stream. Streams and filesMultipartStream::seek– Seek to a position in the stream. Streams and filesMultipartStream::tell– Returns the current position of the file read/write pointer Streams and filesMultipartStream::write– Write data to the stream. Streams and filesMultipartStreamInterface::getContentType– Return the value of the Content-Type header, with the boundary parameter. Streams and filesMySQLiAwaiter::await– Suspends the calling coroutine until the connection's asynchronous query has finished. Blocking calls and the extensionMySQLiPoll::poll–
N#
NetworkException– No response arrived, or the response stopped arriving, because of a network failure. HTTP client
P#
phasync– The static API of phasync: start coroutines, wait for them, cancel them, and wait for streams and flags. CoroutinesPollerInterface– Waits for streams on behalf of the event loop. The event loopPool– A pool of interchangeable resources, of which only so many may exist at once. Resource managementProcess– Starts a child process whose standard streams are used from coroutines without blocking the others. ProcessesProcessInterface– A child process started with Process::run(), with its standard streams usable from coroutines. ProcessesProcessRunner– The implementation behind Process::run(): starts a child process and controls it. Processesphasync::await– Waits for a coroutine or a promise, and returns its result or throws the exception it ended with. Coroutinesphasync::awaitFlag– Suspends the current coroutine until $signal is raised with phasync::raiseFlag. Waiting and timeoutsphasync::cancel– Cancels a coroutine with a CancelledException. Cancellation and cleanupphasync::channel– Creates a channel and returns its two ends in $read and $write. Channels and messagingphasync::finally– Registers $fn to run when the current coroutine ends, or when the nested run() it is in returns. Cancellation and cleanupphasync::frame– Returns the frame of the running coroutine: that of the innermost run() it is in. Scopes and framesphasync::getFiber– Returns the running coroutine. The event loopphasync::getLoop– Returns the event loop, for code that waits with its low-level API (getSlot(), park() and unpark() of the returned object), or drives it in place (tick()). The event loopphasync::go– Starts $fn as a coroutine in the current frame and scope, and returns it, without waiting for it. Coroutinesphasync::idle– Suspends the current coroutine until the event loop has had nothing to run for at least $after seconds: the ready queue and the callback queue are both empty, and an immediate poll finds no I/O ready. Waiting and timeoutsphasync::isRunning– Returns true while a phasync::run is in progress, and false otherwise. The event loopphasync::onScopeChange– Registers $fn to be called when the current Scope changes as the event loop switches coroutines. Scopes and framesphasync::onSignal– Run $handler the moment $signo arrives, inside the signal handler: with pcntl_async_signals(true) in the middle of whatever is executing, even a coroutine that never yields; otherwise when the event loop dispatches signals. For what must happen at that moment, such as logging where a stuck process is; it must not suspend (no await, sleep or phasync I/O). Coroutines in phasync::signal are woken for the same signal as well. phasync takes the signal over until the outermost phasync::run() returns (a previous pcntl_signal() handler is called as well, and put back then), so register it for a run. Cancellation and cleanupphasync::publisher– Creates a publisher: what is written to $publisher is delivered to every subscription of $subscribers. Channels and messagingphasync::raiseFlag– Wakes every coroutine waiting for $signal in phasync::awaitFlag, and returns how many it woke. Waiting and timeoutsphasync::readable– Suspends the coroutine until the stream can be read without blocking, and returns the stream. Waiting and timeoutsphasync::run– Runs $fn and returns its result once it and every coroutine started inside it have ended. Coroutinesphasync::service– Starts $fn as a service: a coroutine of no frame, in the root scope, which outlives the code that started it, and returns it. The event loopphasync::shielded– Run $fn out of every cancellation's reach: phasync::cancel(), Frame::cancel(), and phasync::shutdown() don't cut its waits short. A cancellation that comes meanwhile applies at the coroutine's first wait after $fn returns. For infrastructure that must finish what it started, such as a server ending a protocol cleanly while the application's coroutines stop; application code rarely needs it. Cancellation and cleanupphasync::shutdown– Stop the program's coroutines: every coroutine but the caller, whatever frame it is in, gets $exception (a ShutdownException, which is a CancelledException) at its wait, as phasync::cancel() does, and has up to $window seconds to clean up: finally blocks, and phasync::finally() callbacks, which may wait. Returns how many are still running after that, for the caller to decide (for example to exit, dropping them). Cancellation and cleanupphasync::signal– Suspends the current coroutine until one of $signals (POSIX signal numbers such as SIGTERM) arrives, and returns the one that did. Any number of coroutines may wait for the same signal: each is woken. The waiter runs as an ordinary coroutine afterwards, so it may await, write and close connections; the signal's handler only records it, and the event loop wakes the waiters between coroutines, never inside one. A signal that came before the wait began doesn't end it. Cancellation and cleanupphasync::sleep– Pauses the current coroutine for $seconds, and lets the others run meanwhile. Waiting and timeoutsphasync::throw– Interrupts the wait of a suspended coroutine with $exception, once. Cancellation and cleanupphasync::writable– Suspends the coroutine until the stream can be written without blocking, and returns the stream. Waiting and timeoutsphasync::yield– Suspends the current coroutine until the loop has made its next round, after the coroutines that were ready have run. CoroutinesPollerInterface::poll– Waits up to $timeout seconds until a waited-for stream is ready, and unparks the waiters of those that are. The event loopPollerInterface::readable– Parks the current coroutine until poll() finds $stream readable. The event loopPollerInterface::writable– Parks the current coroutine until poll() finds $stream writable. The event loopPool::__construct– Creates an empty pool; instances are made when they are needed. Resource managementPool::borrow– Lends an instance to the caller until it calls release() or discard(), and waits while all are out. Resource managementPool::count– Returns the number of instances in existence: lent out, being made, and idle. Resource managementPool::discard– Gives a borrowed instance back as broken: the pool forgets it, passes it to $dispose, and makes a new one when needed. Resource managementPool::release– Gives a borrowed instance back, for the next borrower. Resource managementPool::use– Runs $fn with an instance of its own, and releases the instance afterwards, also when $fn throws. Resource managementProcess::run– Starts $command in the background and returns the object that controls it. ProcessesProcessInterface::getExitCode– Returns the exit code of the process, or false while it runs. ProcessesProcessInterface::getStream– Returns the stream of a standard descriptor, for stream_select(), phasync::readable() and the like. ProcessesProcessInterface::isRunning– Returns true if the process is running. ProcessesProcessInterface::isStopped– Returns true if the process is paused by a stop signal. ProcessesProcessInterface::read– Waits until the stream has something to read, and returns what is there. ProcessesProcessInterface::sendSignal– Sends a signal to the process, and returns false without sending it if the process is not running. ProcessesProcessInterface::stop– Ends the process: SIGTERM, then SIGKILL after one second, and waits up to five seconds in all. ProcessesProcessInterface::write– Waits until the stream can take data, and writes as much as it takes. ProcessesProcessRunner::__construct– Starts the process. ProcessesProcessRunner::getExitCode– Returns the exit code of the process, or false while it runs. ProcessesProcessRunner::getStream– Returns the stream of a standard descriptor. ProcessesProcessRunner::isRunning– Returns true if the process is running. ProcessesProcessRunner::isStopped– Returns true if the process is paused by a stop signal. ProcessesProcessRunner::read– Waits until the stream has something to read, and returns what is there; an empty string at the end of the stream. ProcessesProcessRunner::sendSignal– Sends a signal to the process, and returns false without sending it if the process is not running. ProcessesProcessRunner::sigcont– Sends SIGCONT, which resumes a process paused by sigstop(). ProcessesProcessRunner::sighup– Sends SIGHUP, which many daemons take as a request to reload their configuration. ProcessesProcessRunner::sigint– Sends SIGINT, the signal of Ctrl+C. ProcessesProcessRunner::sigkill– Sends SIGKILL, which a process cannot catch or ignore. ProcessesProcessRunner::sigstop– Sends SIGSTOP, which pauses the process until sigcont(). ProcessesProcessRunner::sigterm– Sends SIGTERM, which a process can catch to shut down. ProcessesProcessRunner::stop– Ends the process: SIGTERM, then SIGKILL after one second, and waits up to five seconds in all. ProcessesProcessRunner::write– Waits until the stream can take data, and writes as much as it takes; false if the process is not running. Processes
Q#
Queue– A first-in first-out queue whose operations take a lock, so coroutines may share it. Channels and messagingQueueInterface– A first-in first-out queue that coroutines may share. Channels and messagingQueue::__construct– Creates an empty queue. Channels and messagingQueue::count– Returns the number of values in the queue. Channels and messagingQueue::enqueue– Adds $value at the end of the queue. Channels and messagingQueue::isEmpty– Returns true if the queue holds no values. Channels and messagingQueue::lock– Runs $callable while holding the lock of this object, and returns what it returns. Channels and messagingQueue::tryDequeue– Takes the first value off the queue into $value, and returns whether there was one. Channels and messagingQueue::tryPeek– Copies the first value of the queue into $value, without removing it, and returns whether there was one. Channels and messagingQueueInterface::enqueue– Adds $value at the end of the queue. Channels and messagingQueueInterface::isEmpty– Returns true if the queue holds no values. Channels and messagingQueueInterface::tryDequeue– Takes the first value off the queue into $value, and returns whether there was one. Channels and messagingQueueInterface::tryPeek– Copies the first value of the queue into $value, without removing it, and returns whether there was one. Channels and messaging
R#
RateLimiter– Lets events pass at a fixed rate, shared by every coroutine that calls wait(). Coordination and limitsReadChannelInterface– The reading end of a channel: values written to the channel arrive here in the order they were written. Channels and messagingRequest– A PSR-7 outgoing, client-side request. HTTP clientRequestException– The request could not be sent because it is invalid. HTTP clientResponse– A PSR-7 response. HTTP clientRethrowExceptionInterface– Marks the exceptions that phasync rethrows with a stack trace that begins in the code that called phasync, not inside it. CoroutinesRateLimiter::__construct– Creates the limiter and starts its coroutine. Coordination and limitsRateLimiter::await– Waits for a permit and takes it. Coordination and limitsRateLimiter::isReady– Returns true if a permit is available. Coordination and limitsRateLimiter::wait– Waits for a permit, which delays the coroutine as much as the rate requires. Coordination and limitsReadChannelInterface::activate– Switches off the deadlock check of the channel. Channels and messagingReadChannelInterface::close– Closes the channel, for both ends. Channels and messagingReadChannelInterface::isClosed– Returns true if the channel has been closed, also when values are left to read. Channels and messagingReadChannelInterface::isReadable– Returns true if the channel is open, or has values left to read. Channels and messagingReadChannelInterface::read– Returns the next value, and waits while there is none and the channel is open. Channels and messagingRequest::__clone– Clones the URI set with withUri(), so a copy does not share it. HTTP clientRequest::__construct– Creates a request. HTTP clientRequest::create– Creates a request from a URI, deriving the request-target and Host header from it. HTTP clientRequest::getBody– Gets the body of the message. HTTP clientRequest::getHeader– Retrieves a message header value by the given case-insensitive name. HTTP clientRequest::getHeaderLine– Retrieves a comma-separated string of the values for a single header. HTTP clientRequest::getHeaders– Returns the message headers. HTTP clientRequest::getMethod– Retrieves the HTTP method of the request. HTTP clientRequest::getProtocolVersion– Retrieves the HTTP protocol version as a string. HTTP clientRequest::getQuery– The query string from the request target, or from the URI override when one is attached. HTTP clientRequest::getRequestTarget– Returns the request target of the message. HTTP clientRequest::getUri– Returns the attached URI override, or a URI derived from the request-target plus the Host header. HTTP clientRequest::hasHeader– Checks if a header exists by the given case-insensitive name. HTTP clientRequest::withAddedHeader– Return an instance with the specified header appended with the given value. HTTP clientRequest::withBody– Return an instance with the specified message body. HTTP clientRequest::withHeader– Return an instance with the provided value replacing the specified header. HTTP clientRequest::withMethod– Return an instance with the provided HTTP method. HTTP clientRequest::withoutHeader– Return an instance without the specified header. HTTP clientRequest::withProtocolVersion– Return an instance with the specified HTTP protocol version. HTTP clientRequest::withRequestTarget– Return an instance with the specific request-target. HTTP clientRequest::withUri– Returns an instance with the provided URI. HTTP clientResponse::__construct– Creates a response. HTTP clientResponse::getBody– Gets the body of the message. HTTP clientResponse::getHeader– Retrieves a message header value by the given case-insensitive name. HTTP clientResponse::getHeaderLine– Retrieves a comma-separated string of the values for a single header. HTTP clientResponse::getHeaders– Returns the message headers. HTTP clientResponse::getProtocolVersion– Retrieves the HTTP protocol version as a string. HTTP clientResponse::getReasonPhrase– Gets the response reason phrase associated with the status code. HTTP clientResponse::getStatusCode– Gets the response status code. HTTP clientResponse::hasHeader– Checks if a header exists by the given case-insensitive name. HTTP clientResponse::withAddedHeader– Return an instance with the specified header appended with the given value. HTTP clientResponse::withBody– Return an instance with the specified message body. HTTP clientResponse::withHeader– Return an instance with the provided value replacing the specified header. HTTP clientResponse::withoutHeader– Return an instance without the specified header. HTTP clientResponse::withProtocolVersion– Return an instance with the specified HTTP protocol version. HTTP clientResponse::withStatus– Returns a copy with the status $code, and $reasonPhrase, or the standard phrase for the code when it is ''. HTTP clientRethrowExceptionInterface::rebuildStackTrace– Replaces the stack trace with one that starts where the exception was rethrown. Coroutines
S#
SelectableInterface– An object that can be asked whether using it would block, and waited for until it would not. Waiting and timeoutsServerRequest– A PSR-7 request as a server received it. HTTP clientShutdownException– Thrown into the coroutines of a run by phasync::shutdown(): the program is stopping. It is a CancelledException, so it behaves like one: the coroutine meets it at its wait, its finally blocks run, and cleanup that must wait belongs in phasync::finally(). Code that only needs to stop catches nothing, or CancelledException; code that must tell someone why catches this. Cancellation and cleanupStringBuffer– A buffer of streamed bytes that one coroutine fills and another reads, for parsing protocols that arrive in frames. Streams and filesStringStream– A readable, seekable PSR-7 stream over a string that is known in full. Streams and filesSubscriberInterface– A subscription to a publisher: a reading end that receives every message published after it was made. Channels and messagingSubscribersInterface– The subscription point of a publisher: each call to subscribe() makes a reader that receives every later message. Channels and messagingSynchronized– A mutex for coroutines, identified by a string or an object: only one coroutine at a time runs a closure for the same token. Coordination and limitsSelectableInterface::await– Waits until the object is ready: using it would not block. Waiting and timeoutsSelectableInterface::isReady– Returns true when using the object would not block, for example because data is available or the source is closed or failed. Waiting and timeoutsServerRequest::__clone– Clones a parsed body that is an object, so a copy does not share it. HTTP clientServerRequest::__construct– Creates a server request. HTTP clientServerRequest::cookies– The cookies of a Cookie header, as PHP fills $_COOKIE: the first of equal names wins, values are URL-decoded. HTTP clientServerRequest::getAttribute– Retrieve a single derived request attribute. HTTP clientServerRequest::getAttributes– Retrieve attributes derived from the request. HTTP clientServerRequest::getBody– Gets the body of the message. HTTP clientServerRequest::getCookieParams– Retrieve cookies. HTTP clientServerRequest::getParsedBody– Retrieve any parameters provided in the request body. HTTP clientServerRequest::getQueryParams– Retrieve query string arguments. HTTP clientServerRequest::getServerParams– Retrieve server parameters. HTTP clientServerRequest::getUploadedFiles– Retrieve normalized file upload data. HTTP clientServerRequest::getUri– Adds HTTPS detection from server params ('on' or '1') on top of Request::getUri. HTTP clientServerRequest::withAttribute– Returns a copy with the attribute $name set to $value, for what middleware derived from the request. HTTP clientServerRequest::withBody– Return an instance with the specified message body. HTTP clientServerRequest::withCookieParams– Return an instance with the specified cookies. HTTP clientServerRequest::withoutAttribute– Return an instance that removes the specified derived request attribute. HTTP clientServerRequest::withParsedBody– Return an instance with the specified body parameters. HTTP clientServerRequest::withQueryParams– Return an instance with the specified query string arguments. HTTP clientServerRequest::withUploadedFiles– Create a new instance with the specified uploaded files. HTTP clientStringBuffer::__construct– Creates an empty buffer. Streams and filesStringBuffer::await– Waits until the buffer has data to read or has ended. Streams and filesStringBuffer::end– Marks the end of the stream: no more writes are accepted, and readers get the data left and then the end. Streams and filesStringBuffer::eof– Returns true if the buffer has ended and all its data has been read. Streams and filesStringBuffer::getDeadmanSwitch– Get a deadman switch for this object. Streams and filesStringBuffer::isEmpty– Returns true if no data is buffered for reading. Streams and filesStringBuffer::isReady– Returns true if a read would not wait: data is buffered, or the buffer has ended or failed. Streams and filesStringBuffer::read– Returns up to $maxLength bytes, and waits while the buffer is empty and not ended. Streams and filesStringBuffer::readFixed– Returns exactly $length bytes, and waits until that many are buffered. Streams and filesStringBuffer::readFromResource– Starts a coroutine that reads the stream into the buffer, and ends the buffer when the stream ends. Streams and filesStringBuffer::unread– Puts $chunk back at the front of the buffer, to be read first. Streams and filesStringBuffer::write– Appends $chunk to the buffer, and wakes the reader. Streams and filesStringBuffer::writeToResource– Starts a coroutine that writes the buffer to the stream until the buffer has ended and been read. Streams and filesStringStream::__construct– Creates a stream with $contents. Streams and filesStringStream::__toString– Returns the whole content, and moves the read position to its end. Streams and filesStringStream::close– Closes the stream and any underlying resources. Streams and filesStringStream::detach– Separates any underlying resources from the stream. Streams and filesStringStream::eof– Returns true if the stream is at the end of the stream. Streams and filesStringStream::getContents– Returns the remaining contents in a string Streams and filesStringStream::getMetadata– Get stream metadata as an associative array or retrieve a specific key. Streams and filesStringStream::getSize– Get the size of the stream if known. Streams and filesStringStream::isReadable– Returns whether or not the stream is readable. Streams and filesStringStream::isSeekable– Returns whether or not the stream is seekable. Streams and filesStringStream::isWritable– Returns whether or not the stream is writable. Streams and filesStringStream::read– Read data from the stream. Streams and filesStringStream::rewind– Seek to the beginning of the stream. Streams and filesStringStream::seek– Seek to a position in the stream. Streams and filesStringStream::tell– Returns the current position of the file read/write pointer Streams and filesStringStream::write– Write data to the stream. Streams and filesSubscribersInterface::subscribe– Creates a subscription that receives the messages published after this call. Channels and messagingSynchronized::run– Runs $closure once no other coroutine runs a closure for $token, and returns what it returns. Coordination and limits
T#
TimeoutException– A wait with a timeout ran out before it was satisfied. Waiting and timeouts
U#
UnbufferedStream– A PSR-7 stream for a body that is still being produced, read once and in order. Streams and filesUploadedFile– A PSR-7 file uploaded with a request. Streams and filesUri– A PSR-7 URI. HTTP clientUnbufferedStream::__construct– Creates an empty stream, owned by the current coroutine. Streams and filesUnbufferedStream::__toString– Returns the rest of the stream, or a message starting with "Stream Error" when it cannot: it was closed or detached, or this is the coroutine that created the stream. Streams and filesUnbufferedStream::append– Adds $chunk to the end of the stream. Streams and filesUnbufferedStream::close– Discards the unread content. Streams and filesUnbufferedStream::detach– Separates any underlying resources from the stream. Streams and filesUnbufferedStream::end– Declares that nothing more will be appended, which lets a reader reach the end of the stream. Streams and filesUnbufferedStream::eof– Returns true if the stream is at the end of the stream. Streams and filesUnbufferedStream::getContents– Returns the remaining contents in a string Streams and filesUnbufferedStream::getMetadata– Get stream metadata as an associative array or retrieve a specific key. Streams and filesUnbufferedStream::getSize– Get the size of the stream if known. Streams and filesUnbufferedStream::isReadable– Returns whether or not the stream is readable. Streams and filesUnbufferedStream::isSeekable– Returns whether or not the stream is seekable. Streams and filesUnbufferedStream::isWritable– Returns whether or not the stream is writable. Streams and filesUnbufferedStream::read– Read data from the stream. Streams and filesUnbufferedStream::rewind– Seek to the beginning of the stream. Streams and filesUnbufferedStream::seek– Seek to a position in the stream. Streams and filesUnbufferedStream::tell– Returns the current position of the file read/write pointer Streams and filesUnbufferedStream::write– Write data to the stream. Streams and filesUploadedFile::__construct– Creates an uploaded file. Streams and filesUploadedFile::getClientFilename– Retrieve the filename sent by the client. Streams and filesUploadedFile::getClientMediaType– Retrieve the media type sent by the client. Streams and filesUploadedFile::getError– Retrieve the error associated with the uploaded file. Streams and filesUploadedFile::getSize– Retrieve the file size. Streams and filesUploadedFile::getStream– Retrieve a stream representing the uploaded file. Streams and filesUploadedFile::moveTo– Moves the file to $targetPath, once. Streams and filesUri::__construct– Creates a URI from $uri. HTTP clientUri::__toString– Returns the URI as a string. HTTP clientUri::getAuthority– Retrieve the authority component of the URI. HTTP clientUri::getFragment– Returns the fragment of the URI: what follows the "#". HTTP clientUri::getHost– Returns the host of the URI, lower case. HTTP clientUri::getParam– Returns the value of the query parameter $param, an array for name[] parameters, or null when it is not there. HTTP clientUri::getPassword– Returns the password of the URI. HTTP clientUri::getPath– Returns the path of the URI, up to the query and fragment. HTTP clientUri::getPort– Retrieve the port component of the URI. HTTP clientUri::getQuery– Returns the query of the URI: what follows the "?", up to the fragment. HTTP clientUri::getScheme– Returns the scheme of the URI, lower case. HTTP clientUri::getUser– Returns the user of the URI. HTTP clientUri::getUserInfo– Retrieve the user information component of the URI. HTTP clientUri::jsonSerialize– Returns the URI as a string, like __toString(). HTTP clientUri::withFragment– Returns a copy of the URI with the fragment replaced. HTTP clientUri::withHost– Returns a copy of the URI with the host replaced; '' removes it. HTTP clientUri::withPath– Returns a copy of the URI with the path replaced. HTTP clientUri::withPort– Returns a copy of the URI with the port replaced; null removes it. HTTP clientUri::withQuery– Returns a copy of the URI with the query replaced. HTTP clientUri::withScheme– Returns a copy of the URI with the scheme replaced. HTTP clientUri::withUserInfo– Returns a copy of the URI with the user and password replaced. HTTP client
W#
WaitGroup– Waits until a counted amount of work has been done, like Go's sync.WaitGroup. Coordination and limitsWriteChannelInterface– The writing end of a channel: write() sends a value to the readers of the channel. Channels and messagingWaitGroup::add– Adds $delta to the counter of unfinished work. Coordination and limitsWaitGroup::await– Waits until the counter is zero. Coordination and limitsWaitGroup::done– Marks one piece of work as done. Coordination and limitsWaitGroup::isReady– Returns true when the counter is zero: nothing is left to wait for. Coordination and limitsWaitGroup::wait– Waits until the counter is zero. Coordination and limitsWriteChannelInterface::activate– Switches off the deadlock check of the channel. Channels and messagingWriteChannelInterface::close– Closes the channel, for both ends. Channels and messagingWriteChannelInterface::isClosed– Returns true if the channel has been closed. Channels and messagingWriteChannelInterface::isWritable– Returns true if the channel is open, so a write is accepted. Channels and messagingWriteChannelInterface::write– Sends a value, and waits while the channel cannot take it: for a reader on an unbuffered channel, for room on a full buffer. Channels and messaging