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
10
votes
2 answers

Guzzle vs ReactPHP vs Amphp for parallel requests

What's the difference between: GuzzleHttp ReactPHP Amphp How they differ and what would be typical use case to use with?
lubosdz
  • 4,210
  • 2
  • 29
  • 43
8
votes
1 answer

How does amphp work

The docs on their website http://amphp.org/faq is not very clear to me. Things are confusing to me. Is it intended to run as a server ?? or run as CLI ? or run within a web container ( apache, nginx fpm ) ? And php is sync by nature, how could it…
Phung D. An
  • 2,402
  • 1
  • 22
  • 23
3
votes
0 answers

Error while using Amphp parallel with user defined function

I am trying to call a user-defined function using Worker\enqueueCallable. I have put the function in a separate file and used composer to autoload it. And I am getting the error : Fatal error: Uncaught TypeError: Argument 1 passed to…
3
votes
1 answer

Class Amp non found

I'm new on amphp and i'd like to try this very simple code first. I downloaded amphp with composer for windows and save all folder created inside my project folder. composer require amphp/http-client Then my code is:
itajackass
  • 346
  • 1
  • 2
  • 15
3
votes
2 answers

How the Amphp parallel works?

I was reading about amphp, and I had a doubt about parallel Example code:
kobra101
  • 33
  • 1
  • 3
3
votes
1 answer

How to create a callable method/function in PHP

I'm trying to achieve multitasking in PHP. At the moment I'm evaluating AMPHP framework, and in particular paralell and paralel-functions. But I can't figure how is to create a method callable... The idea is that I will have a Class with some…
Nicolas400
  • 563
  • 1
  • 7
  • 29
3
votes
2 answers

PHP framework AMPHP/THREAD used with SYMFONY - Where does it have to be installed?

I am looking to implement the framework amphp/thread, with Symfony3, which I ve read about in this article (https://www.mullie.eu/parallel-processing-multi-tasking-php/). I'd looked at the setting process on the git page:…
nyluje
  • 3,573
  • 7
  • 37
  • 67
2
votes
0 answers

Count of working workers less then maximum pool size

Good day. I use amphp parallel-functions. I set the maximum pool size to 128 - the number of workers is stable at 128. I set it to 256 - I get different values for the number of working workers from launch to launch. But always less than the maximum…
2
votes
1 answer

AMPHP throws an uncatchable MultiReasonException - Is this a bug?

I'm getting a MultiReasonException thrown during a DNS lookup as part of a AMP Socket connect call. The actual exception thrown is an NX domain, which is fine - the lookup is for a host which is down currently. The problem is I cannot catch and…
2
votes
1 answer

AMPHP - Queueing more Tasks than available Workers in Pool

I have a project in which I am converting a large amount of .tif images into PDF documents. File count goes into millions. To speed up the process I am using Amphp. Since the process of converting the images with Imagemagick takes up some cpu power…
Shinidoki
  • 41
  • 5
2
votes
1 answer

How to call class method inside worker CallableTask in amphp/parallel Amp\Loop?

I'm using the Amp\Loop and want to know that what is the correct way of calling class method with arguments in $worker->enqueue(new CallableTask()). Here is an example:
2
votes
2 answers

Async http call with php

I have a situation where I have a loop, that is going to read chunk of data from a file, send those chunk to a rest api, and continue until the EOF, but I want this to be async inside the loop, so, I don't have to wait until the API respond to read…
Peter
  • 123
  • 1
  • 9
2
votes
0 answers

How to implement amphp/websocket-client in laravel

I am trying to get the datafeed from Kite Connect via async web socket. I think that I can use amphp/websocket-client library in my Laravel project but I am clueless where to begin. How to integrate this library to get the data feed in my Laravel…
Besto
  • 109
  • 1
  • 11
2
votes
1 answer

Long running script that polls external server with variable backoff timer?

I am writing a long running script based on Amphp library, that will poll a external server for a list of tasks to run and then execute those tasks. In the response from the server would be the backoff timer that would control when the script makes…
1
vote
1 answer

Do i really have to restart the server everytime i made changes?

i want to use AMP PHP and create a Project. So i started with one of the examples on github and i can see hello world. Now if i make changes to my code, i have to restart everytime the server. but this is not how it should work right? Do i have to…
Vitalij Mik
  • 542
  • 3
  • 6
1
2 3 4