php-resque icon indicating copy to clipboard operation
php-resque copied to clipboard

Fastcgi

Open ebernhardson opened this issue 12 years ago • 6 comments

As discussed in issue #76 this is a refactor of the the current fork/in-process strategy into independent objects along with the addition of a fastcgi strategy to utilize php-fpm.

A couple notes:

To pass the job between the worker and fastcgi I settled on serializing the job and passing as an environment variable. Specifically when failing a job both the worker and job instances are required. I thought it best to serialize and pass both rather than make changes to the failure code.

I pulled the FCGIClient into the repository, currently under the BitTP namespace as that is where i found it. I had to make a few changes to this class to make it fit our usage; Specifically it was originally written using non-blocking sockets and busy-waiting to read the socket. For our purposes a blocking fastcgi client is more appropriate so i made that change. It may be more appropriate to re-namespace or put into a repo on its own to be referenced by composer.

I could not come up with a good way to programmatically test this code. Its fairly straight forward code, and I've run numerous tests by hand, but needs automated on-going testing one way or the other. I'm open to suggestions which i can flush out into proper tests.

ebernhardson avatar Jan 13 '13 09:01 ebernhardson

This looks good :thumbsup:.

Before I bring it in, I want to work on externalizing the FCGIClient (essentially creating a Composer package for it), and obviously work on the testing. If you don't have the time to do this, I'll probably begin work on getting this down sometime in the next two weeks.

Nice job!

chrisboulton avatar Jan 14 '13 09:01 chrisboulton

The FastCGI client has been extracted into a suggested package, https://github.com/ebernhardson/fastcgi , and the pull request has been updated.

Still need to figure out a full featured way to test the JobStrategy interactions.

ebernhardson avatar Feb 02 '13 04:02 ebernhardson

Awesome. :thumbsup:

Sorry, I meant to spend some time on this but dropped the ball because I've been busy with work and life at the moment. I definitely appreciate the effort you're putting into this.

chrisboulton avatar Feb 02 '13 10:02 chrisboulton

what is the status on this PR ? is help needed ?

allan-simon avatar Apr 30 '15 04:04 allan-simon

I'd love to see this, or something very much like it, in the new repo at resque/php-resque, if anyone would like to pick it up and rebase/rebuild it there?

danhunsaker avatar Dec 11 '18 07:12 danhunsaker

@ebernhardson Hello and sorry for digging up this old pull request. This approach seems quite interesting to me from a performance perspective. Did you ever end up running this in production?

adri avatar Aug 07 '23 17:08 adri