Comments (11)
Can't wait to see some progress on this! Qu is great so far, but still needs some additional features to become awesome.
from qu.
@fbjork Thanks, I hope to make some progress en route to RubyConf this week. Please do let me know what other features you think would make it awesome!
from qu.
Hello,
If I can comment, I think there are two approaches to this:
a in-memory backend that performs the enqueued job right away after enqueued,
Or, a kind of worker that do not trap signals or anything.
As example, for Resque we ended creating the following:
module Helpers
def do_delayed_work!
worker = SpecWorker.new('*')
worker.work
end
end
class SpecWorker < Resque::Worker
def work(interval = 5, &block)
while job = reserve
working_on job
perform(job, &block)
done_working
end
end
end
Which is far from being pretty, but allowed us to execute the enqueued jobs.
Just my two cents.
BTW: great work on Qu, really loving it!
from qu.
@luislavena great suggestions. You can use the existing worker to work off jobs in tests and it won't trap signals:
Qu::Worker.new('queue1', 'queue2').work_off
I was thinking I would implement test mode using hooks and work off the job after it is enqueued. I'm leaning toward this solution because it still goes through the whole stack and will make sure the args are serializable/deserializable.
from qu.
I was thinking I would implement test mode using hooks and work off the job after it is enqueued. I'm leaning toward this solution because it still goes through the whole stack and will make sure the args are serializable/deserializable.
Great approach, however there should be a way to control it. Under certain specs I would not like any job being performed.
Also, wouldn't Qu.enqueue
and Qu::Worker.new(...).work_off
exercise the args serialization?
from qu.
Yep, enqueue and work_off would do it. That's how our tests for speakerdeck.com currently work.
On Sep 30, 2011, at 8:49 AM, Luis [email protected] wrote:
I was thinking I would implement test mode using hooks and work off the job after it is enqueued. I'm leaning toward this solution because it still goes through the whole stack and will make sure the args are serializable/deserializable.
Great approach, however there should be a way to control it. Under certain specs I would not like any job being performed.
Also, wouldn't
Qu.enqueue
andQu::Worker.new(...).work_off
exercise the args serialization?Reply to this email directly or view it on GitHub:
#6 (comment)
from qu.
I suggest going with an in memory approach to avoid writing to Redis and adding jobs to the development queues. If not perhaps the jobs should be namespaced with the environment, i.e 'development-my_queue' or something along those lines.
from qu.
how about https://gist.github.com/1391531 approach?
from qu.
@sumskyi: looks like a good start to me. Want to submit a pull request with it?
from qu.
from qu.
Awesome, thanks!
from qu.
Related Issues (20)
- RabbitMQ vs Bunny HOT 3
- Docs don't match current release version? HOT 3
- jobs processed even when queue is not running HOT 6
- [HireFire] Extract a "working" worker's job's queue name HOT 3
- Question: How to handle completed jobs? Any callback? HOT 1
- Auto Redic/Mongo mount while rake spec HOT 1
- Failing test for Mongo backend HOT 1
- db_name must be a string or symbol HOT 6
- Daemonize qu:work HOT 1
- Current status of project HOT 6
- Backend should be notified of failures HOT 1
- Raise error if no queue given to worker HOT 1
- Jobs are currently retried until they succeed
- Worker heartbeat HOT 4
- New gem release? HOT 1
- Move kestrel thrift stuff to its own gem HOT 1
- Release new version HOT 1
- Process payloads in batches HOT 6
- Allow backends to implement batch pop
- Allow backends to implement batch push HOT 1
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 qu.