Comments (7)
Ok, this is seriously cool. 😎
I'd definitely be interested in having this built in, and it might help others such as @salimane who have been trying to work with the overhead of a forking model. It will also improve the error handling/catching for failed jobs as you'll be able to get the actual error message for a job that fatal errors out and would normally leave you with a "DirtyExit" exception.
It'd be super cool to get this working via sockets at some stage as well.
I can sort of see there being different strategies for job execution - Resque_JobStrategy_Fork, Resque_JobStrategy_Fastcgi, and you can configure one at runtime. Thoughts?
from php-resque.
hi
@ebernhardson @chrisboulton this is interesting. one quick problem I could see is long running jobs over fastcgi. May be something could be done to adjust for this. But as long as this is space and resource efficient than fork, I'm all for it.
Thanks
from php-resque.
Job strategies sound like a good approach to this. I took a stab at refactoring the current code into a strategy pattern, let me know what you think. I'm not sure that perform is the right name for the method on Resque_JobStrategy_Interface, suggestions welcome.
I also have some worry about Resque_Worker::killChild, in that the InProcess strategy has no way to kill the job(when triggered from SIGUSR1), and closing the fpm socket in the Fastcgi strategy wont necessarily stop fpm from finishing the job either. Perhaps a few notes in the documentation is all that is required though.
ebernhardson/php-resque@36f5353
@salimane
Long running tasks are certainly a valid concern. We can always set max_execution_time to 0 from the worker code so it matches the CLI environment, but running some specific testing will be worth the time invested. The time and space efficiency really need to be measured to have any certainty. My intuition tells me it wont be as clear cut as the initial benchmarks show, and will depend on the use case.
from php-resque.
I quickly went through the changes at ebernhardson/php-resque@36f5353 . If I understand this correctly, this proposal comes down to instead of running the jobs within a child of the worker process, run the jobs directly in the worker process. is this so ?
from php-resque.
@salimane The changes in the fork dont represent fcgi yet. The first step here was just to see if @chrisboulton is ok with the direction of the refactor before i start plugging in and writing tests for fastcgi. The linked refactor passes all the original tests and should have exactly the same functionality as the current php-resque code. With the fastcgi in all jobs will be executed by the php-fpm manager, similar to how nginx would run run webpages through php-fpm. Connecting and running scripts through fpm is demonstrated from the gist in the first post.
from php-resque.
@ebernhardson ok got it :)
from php-resque.
So... How's this coming along? I see PR #81, but it doesn't have any recent updates, either...
from php-resque.
Related Issues (20)
- The project has been abandoned? HOT 8
- Is it possible to add a job if it does not exists?
- Job Not Found Error specifications
- Could add a event before work reserve
- QUEUE=mail: Command not found. HOT 2
- Still job not found HOT 4
- Couldnt change the redis host while running the worker HOT 2
- 为什么不增加 redis Auth HOT 1
- event listener for any job HOT 1
- Resque_Job_Status Throughout STATUS_RUNNING
- PHP Warning: fread(): Length parameter must be greater than 0 HOT 2
- Please archive this repository -> This package is abandoned and no longer maintained. The author suggests using the resque/php-resque package instead. HOT 7
- QUEUE=message php vendor/bin/resque HOT 4
- add delay jobs HOT 1
- should check pcntl_wifexited first before pcntl_wexitstatus
- 项目还有人维护吗? HOT 3
- Why not "break"? HOT 1
- The documentation for 'scan' is described HOT 6
- Stat namespace growing
- PHP Deprecated: implode(): Passing glue string after array is deprecated.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from php-resque.