Questions tagged [amphp]

Amp is a non-blocking concurrency framework for PHP applications.

Amp is a non-blocking concurrency framework for PHP applications. It's maintained by the amphp organization, which provides also other libraries based on Amp.

60 questions
0
votes
1 answer

MultiReason Exception in amphp/paralell

I'm trying to call multiples request to some webservices. And I can't figure out how to do this. I'm getting this error: Amp\MultiReasonException Multiple errors encountered I'm trying with this structure: $arr =["ACT","BKH"]; …
Nicolas400
  • 563
  • 1
  • 7
  • 29
0
votes
0 answers

how to consume webservices with amphp/artax?

i'm new to amphp/artax I need to consume several web services in paralell, and join the answers togheter. I achieved request several pages with : .... $response = yield $client->request($uri); …
Nicolas400
  • 563
  • 1
  • 7
  • 29
0
votes
1 answer

PHP Amp/Parallel. Please give me example about parallel function with pool

I have been stuck in my task about running functions in parallel. I has tried this library multi-threading pthreads from krakjoe, but I has limit knowledge about installations in ubuntu. I has tried this amp/parallel instead and other amphp. The…
0
votes
1 answer

Getting the response from HttpKernel for an url, parallelized

I am using https://github.com/JosephSilber/page-cache to cache pages. To prepare pages beforehand (about 100,000), I used to run 8 http requests in parallel via GuzzleHttp. It worked, but was pretty slow, because of the overhead. I am looking for a…
Leif
  • 2,143
  • 2
  • 15
  • 26
0
votes
0 answers

Where to put amphp directory?

I downloaded amphp using composer and it automatically downloaded it toC:\Users\ is that where it's meant to be for usage or do I need to copy it to my local servers directory or htdocs?
theplayer
  • 1
  • 9
0
votes
1 answer

How to redirect amp form on submission to another page?

Below mentioned code is my form code
Md Javed Akhtar
  • 81
  • 1
  • 12
0
votes
1 answer

How to correctly turn closure to promise in amphp?

I'm learning amphp. I want to convert sync call to async call using event loop in amphp. My sample code use file_get_contents as sample blocking call. Using sync call, it look like this: $uris = [ "https://google.com/", …
rahmat
  • 1,727
  • 16
  • 35
0
votes
1 answer

Socket concurrency in PHP

I would like to know if anyone has any good insight into how to open a number of sockets to the same server, write and then read data concurrently in PHP. Should I use a concurrency framework like Amphp or are there better options for this task? How…
madshov
  • 653
  • 3
  • 9
  • 15
0
votes
2 answers

Amphp Artax bug

i used following very basic example of amphp/artax $URL can be any url e.g. http://www.yahoo.com $promises[$URI] = Amp\call(function () use ($client, $URI) { // "yield" inside a coroutine awaits the resolution of the promise …
waleed
  • 93
  • 10
0
votes
1 answer

How to get data from Aerys parseBody if the data doesn't have key

I am working with Aerys but I have a problem. When I send my parameters through post I don't know how to access to the data. In the documentation they use the following function: $body = yield parseBody($request); In the documentation, there…
Jeff
  • 66
  • 2
0
votes
1 answer

Why am I getting "Error: Call to a member function end() on null" using Aerys?

I'm trying to put aerys on top of my cms but getting error. As I see the backend returns not null value - #1 in stacktrace but it doesn't reach $resp->end(). I'm stucked trying to get that value to the end(). Code example $router = router() …
Chel
  • 1
  • 2
0
votes
1 answer

How to make Amphp pool/queue of multiple requests? And where is Curl handler?

There is an example/test code made with the use of GuzzleHttp: use GuzzleHttp\Client; use GuzzleHttp\Handler\CurlHandler; use GuzzleHttp\HandlerStack; use GuzzleHttp\Middleware; use GuzzleHttp\Pool; use Psr\Http\Message\ResponseInterface; require…
iorsa
  • 60
  • 6
0
votes
1 answer

Usage PPM on top of Aerys

There is "Don’t use any blocking I/O functions in Aerys." warning at https://amphp.org/aerys/io#blocking-io. Should I use PPM instead of Aerys if I need usage of PDO (e.g., Prooph components) and want to reuse initialized application instance for…
-1
votes
1 answer

Create Iterator from array with AMPHP

I have an array in php: $array = [1,2,3]; When I do: while(yield $array->advance()) I get Call to a member function advance() on array How do I turn my array into an iterator?
Maarten Raaijmakers
  • 615
  • 2
  • 8
  • 20
-2
votes
1 answer

Azure WebApp custom PHP server

Is in Azure WebApp any possibility to run custom web server instead of IIS? (amphp/aerys or reactphp/http) I think, that with Node.js it is possible, so there should be some way for PHP. Expected behavior is, that I will use my custom PHP server,…
1 2 3
4