Index
Functions
Every function, A to Z, with the topic it belongs to. Type to filter; methods appear when you filter.
5 symbols
E#
ensure_loaded– Ensure the phasync extension is loaded, re-executing this CLI process with -d extension=<matching .so> if it is not. Blocking calls and the extensionEvent::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#
file_get_contents– Reads a whole file, letting other coroutines run while it waits. Blocking calls and the extensionfile_put_contents– Writes a file, letting other coroutines run while it waits. Blocking calls and the extensionflock– Locks a file, letting other coroutines run while it waits for the lock. Blocking calls and the extensionFrame::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
S#
sleep– Suspends the current coroutine for $seconds seconds, letting the others run. Blocking calls and the extensionSelectableInterface::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