Comments (7)
Hey Jacob,
The answer to the first question is a yes. I've tried to keep everything exactly the same as the Ruby version, in terms of job storage, and the actual API/code.
The second should also be a yes, but I haven't had the opportunity to test that. There's no reason why it shouldn't work - you just need to make sure the job class names you pass along exist as classes in your Ruby app. This should also work in the reverse - from Ruby you should be able to have a job queued for execution on a PHP worker. Of course, you just need to make sure the right worker is picking up the right jobs.
from php-resque.
Thanks Chris for the timely response!
I'll let you know how our implementation goes if I can sell it internally.
Best,
Jacob
On Sun, Apr 3, 2011 at 1:30 PM, chrisboulton <
[email protected]>wrote:
Hey Jacob,
The answer to the first question is a yes. I've tried to keep everything
exactly the same as the Ruby version, in terms of job storage, and the
actual API/code.The second should also be a yes, but I haven't had the opportunity to test
that. There's no reason why it shouldn't work - you just need to make sure
the job class names you pass along exist as classes in your Ruby app. This
should also work in the reverse - from Ruby you should be able to have a job
queued for execution on a PHP worker. Of course, you just need to make sure
the right worker is picking up the right jobs.Reply to this email directly or view it on GitHub:
#16 (comment)
+1 512-522-6281
twitter: @jacobSingh ( http://twitter.com/#!/JacobSingh )
web: http://www.jacobsingh.name
Skype: pajamadesign
gTalk: [email protected]
from php-resque.
No worries.
Going to close this out - but definitely reopen it if something's not working as I explained above.
from php-resque.
@jacobSingh wondering whether you were able to do it successfully. i.e. create jobs in PHP which are then executed by Ruby workers?
from php-resque.
Interested to find out as well, but I'm pretty sure Chris has been using it this way successfully for a while... As he pointed out, so long as each only collects jobs it has classes for (separate queues, name spacing, and a few other tricks can be used to ensure this), it should work just fine.
Of course, your version of Ruby Resque might affect this. PHP-Resque hasn't kept pace with the Ruby version's gradual evolution, so you may need to use a version from roughly three years ago or so. I'd roll it back until it works...
But yeah, definitely interested in the response here.
from php-resque.
Yep, this is something we're doing here internally without issue and have been for a while. We have both sides pickup and schedule jobs for each other. Each set of workers checks a different set of queues.
from php-resque.
I apologize for the bump on such an old ticket, but it's near the top of Google results and I wanted to leave this here for other people interested in queueing jobs with PHP to be processed by an existing Ruby Resque server.
THIS DOES WORK. EASILY.
PHP
function queue($job_class = 'Workers::YourWorkerName', $job_data = []) {
Resque::setBackend('localhost:6379');
Resque::enqueue('queue_name_here', $job_class, $job_data);
}
Ruby
# lib/workers/your_worker_name.rb
module Workers
class YourWorkerName
@queue = 'queue_name_here'
def self.perform(opts)
puts opts.inspect
end
end
end
Then, it's as simple as:
PHP
queue('Workers::YourWorkerName', [
'name' => 'Pierce',
'username' => 'rex',
'things' => [
'thing1',
'thing2',
'anotherThing'
]
]);
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.