phasync
Examples
Every example by topic, with the page it belongs to.
Coroutines#
phasyncphasync::runphasync::gophasync::awaitphasync::yieldphasync::runphasync::gophasync::awaitphasync::yieldAggregateExceptionAggregateException::getExceptionsAggregateException::contains
Waiting and timeouts#
phasync::sleepphasync::idlephasync::readablephasync::writablephasync::raiseFlagphasync::awaitFlagIOExceptionSelectableInterfaceTimeoutException
Cancellation and cleanup#
phasync::finallyphasync::cancelphasync::throwphasync::signalphasync::onSignalphasync::shutdownphasync::shieldedCancelledException
Scopes and frames#
phasync::onScopeChangephasync::frameFrameFrame::cancelFrame::setTimeoutFrame::requestCancellationFrame::isCancellationRequestedFrame::setExceptionHandler
Channels and messaging#
phasync::channelphasync::publisherChannelExceptionReadChannelInterfaceReadChannelInterface::readSubscriberInterfaceSubscribersInterfaceSubscribersInterface::subscribeQueueQueueInterfaceWriteChannelInterface
Coordination and limits#
Resource management#
Streams and files#
DeadmanExceptionBufferedStreamStringStreamUnbufferedStreamUploadedFileStringBufferMultipartStream– Upload a file with form fieldsMultipartStreamMultipartStream::__constructMultipartStream::getContentTypeMultipartStreamInterface– The Content-Type comes with the bodyMultipartStreamInterfaceMultipartStreamInterface::getContentType
HTTP client#
RequestResponseServerRequestUriClientException– Too many redirectsClientExceptionCurlResponse– Read the body as it arrivesCurlResponseCurlResponse::getStatusCodeCurlResponse::getHeaderLineCurlResponse::getBodyCurlResponse::getDownloadedBytesHttpClient– Two requests that run togetherHttpClient– Requests in coroutinesHttpClientHttpClient::__constructHttpClient::addMiddlewareFunction– A header and a log line for every requestHttpClient::addMiddlewareFunctionHttpClient::sendRequest– A PSR-18 request, and an error statusHttpClient::sendRequestHttpClient::sendAsyncRequest– Send several, read them laterHttpClient::sendAsyncRequestHttpClient::request– JSON, headers and a query stringHttpClient::requestHttpClient::getHttpClient::post– Post a formHttpClient::postHttpClient::putHttpClientOptions– Defaults, and options for one requestHttpClientOptionsHttpClientOptions::__constructHttpClientOptions::overrideFromNetworkException– Connection refusedNetworkExceptionRequestException– Requests that cannot be sentRequestException