1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
Commit graph

9 commits

Author SHA1 Message Date
Aaron Patterson
3b3ca13307 adding Rails::Queueing::Container
This allows us to do:

In your configuration:
Rails.queue[:image_queue] = SomeQueue.new
Rails.queue[:mail_queue]  = SomeQueue.new

In your app code:
Rails.queue[:mail_queue].push MailJob.new

Both jobs pushed to the same default queue
Rails.queue.push DefaultJob.new
Rails.queue[:default].push DefaultJob.new
2012-07-19 12:09:39 -07:00
Paul Battley
a3ade2e99c Ensure jobs do not refer to the queue
Jobs pushed to the queue should not contain a reference to it. As the queue
itself cannot be marshalled, and as a consequence of checking the
marshallability of all jobs in the test environment, we can now guarantee this
to be the case in the test environment when using the default TestQueue
implementation.
2012-07-03 12:01:53 +01:00
Paul Battley
33113ba0e7 Ensure test jobs are marshallable
By marshalling and unmarshalling jobs when adding them to the test queue, we
can ensure that jobs created during test runs are valid candidates for
marshalling, and, thus, that they can be used with queueing backends other than
the default simple in-process implementation.

This will also be used in a subsequent commit to ensure that jobs pushed to the
queue do not contain a reference to the queue itself.
2012-07-03 12:01:53 +01:00
Paul Battley
8e1d8fd093 Track queue threading with named classes
Using an anonymous class prevented marshalling: we're not doing that yet, but
the next commit will introduce this. This also provided an opportunity to
improve the expressivity of the tests and to make the assertion failure
messages clearer.
2012-07-03 12:01:53 +01:00
Carlos Antonio da Silva
1385388452 Allow configuring a different queue consumer
Also make sure to not use default queue consumer with custom queue
implementation. It is up to the new queue implementation to
start / shutdown the consumer.
2012-05-04 09:11:44 -03:00
Rodrigo Pavano
9ebfd634a7 Removing unused local vars in Queue tests 2012-05-01 15:54:15 -03:00
José Valim
9fc9e89477 Use Rails::Queueing::Queue instead of Queue so people can build their own consumers around stdlib's Queue 2012-04-28 09:26:23 +02:00
Carlos Antonio da Silva
ff4eba9ce2 Fix failing test, TestQueue#contents is not #jobs 2012-04-27 19:51:40 -03:00
Yehuda Katz
602000be90 Missing git add :trollface: 2012-04-26 21:43:12 -07:00