Commit Graph

210 Commits

Author SHA1 Message Date
Jean Boussier
be491ecec2 Fix jobs overriding AJ::Base#logger 2016-06-17 13:04:17 -04:00
Steve Lounsbury
38c187b0cc Provide the ability to override the queue adapter used by jobs under
test.

This PR adds a method called `queue_adapter_for_test` to
`ActiveJob::TestHelper`. This method is expected to provide the queue
adapter to be used for jobs under test. It maintains the current
behaviour by defaulting to an instance of
`ActiveJob::QueueAdapter::TestAdapter`. Tests that include
`ActiveJob::TestHelper` or extend from `ActiveJob::TestCase` can provide
a custom queue adapter by overriding `queue_adapter_for_test` in their
class.
2016-06-11 15:18:52 -04:00
Jake Worth
ffb6ab4fe1 Fix typo, of of -> of [ci skip] 2016-06-09 16:23:58 -05:00
Tim Wade
ad9882369a
[ci skip] Reword doc for around_enqueue callback
Taken literally, the documentation suggests that the callback gets
called twice (before and after enqueueing). By wording it similarly to
that of around_perform this confusion is avoided.
2016-05-27 15:39:30 -07:00
Jeremy Daer
89e2f7e722
Support for unified Integer class in Ruby 2.4+
Ruby 2.4 unifies Fixnum and Bignum into Integer: https://bugs.ruby-lang.org/issues/12005

* Forward compat with new unified Integer class in Ruby 2.4+.
* Backward compat with separate Fixnum/Bignum in Ruby 2.2 & 2.3.
* Drops needless Fixnum distinction in docs, preferring Integer.
2016-05-18 21:58:51 -07:00
Jeremy Daer
e35b98e6f5
Action Mailer: Declarative exception handling with rescue_from.
Follows the same pattern as controllers and jobs. Exceptions raised in
delivery jobs (enqueued by `#deliver_later`) are also delegated to the
mailer's rescue_from handlers, so you can handle the DeserializationError
raised by delivery jobs:

```ruby
class MyMailer < ApplicationMailer
  rescue_from ActiveJob::DeserializationError do
    …
  end
```

ActiveSupport::Rescuable polish:
* Add the `rescue_with_handler` class method so exceptions may be
  handled at the class level without requiring an instance.
* Rationalize `exception.cause` handling. If no handler matches the
  exception, fall back to the handler that matches its cause.
* Handle exceptions raised elsewhere. Pass `object: …` to execute
  the `rescue_from` handler (e.g. a method call or a block to
  instance_exec) against a different object. Defaults to `self`.
2016-05-15 18:44:16 -07:00
Rafael Mendonça França
8ecc5ab1d8 Start Rails 5.1 development 🎉 2016-05-10 03:46:56 -03:00
Rafael Mendonça França
fbdcf5221a Preparing for 5.0.0.rc1 release 2016-05-06 16:54:40 -05:00
eileencodes
f7a986012a Prep Rails 5 beta 4 2016-04-27 15:48:47 -05:00
Graeme Boy
6e27481dc7 Fix typo in ActiveJob #retry_job doc 2016-04-23 17:23:19 -07:00
Mohit Natoo
23f472ae7c - [ci skip] Active Job Async doesn't support to Async feature as per it's definition.
- [ci skip] Active Job Async doesn't support to Async feature as per it's definition.

- [ci skip] Active Job Async doesn't support to Async feature as per it's definition.

- [ci skip] Active Job Async doesn't support to Async feature as per it's definition.

- [ci skip] Active Job Async doesn't support to Async feature as per it's definition.
2016-04-22 15:37:20 +05:30
Eileen M. Uchitelle
e88d63e6f7 Merge pull request #24165 from y-yagi/generate_application_job_when_not_exist
generate ApplicationJob if it does not already exist
2016-04-09 09:46:37 -04:00
yuuji.yaginuma
87824ab583 update assert_no_performed_jobs doc to use assert_no_performed_jobs method [ci skip] 2016-03-30 08:12:49 +09:00
yuuji.yaginuma
9a9fc01af0 generate ApplicationJob if it does not already exist
ActiveJob jobs now inherit from ApplicationJob by default.
However, when updating to Rails 5 from the old Rails,
since there is a possibility that ApplicationJob does not exist.
2016-03-25 13:21:37 +09:00
Mike Perham
8c98186742 Add JSON round trip verification testcase 2016-03-09 09:28:16 -08:00
Mike Perham
702ef37767 Job payload should be symmetric across JSON dump/load
Placing non-native JSON data types, like symbols, in the hash to serialize means that the deserialize method will return something different from what was serialized, a common bug and source of frustration for devs.
2016-03-09 08:56:21 -08:00
Matthew Draper
5bdeb9bfd7 Use AS::Reloader to support reloading in ActiveJob 2016-03-02 02:14:54 +10:30
Jeremy Daer
a66780bfff Active Job: smaller footprint for the dev/test async adapter
Use one shared worker pool for all queues with 0-#CPU workers rather
than separate pools per queue with 2-10*#CPU workers each.
2016-02-29 15:58:26 -07:00
Rafael Mendonça França
116581be91 Do not define methods in the included block
Instance methods can be defined in the module itself
2016-02-24 13:37:32 -03:00
eileencodes
826420b5fc Prep release for Rails 5 beta3 2016-02-24 10:27:02 -05:00
Abhishek Jain
9a2ca9cf69 [ci skip] Fix enqueuing spelling to maintain consistency 2016-02-12 23:49:08 +05:30
yuuji.yaginuma
6809758bc6 fix typo in assert_enqueued_jobs example [ci skip] 2016-02-07 09:12:19 +09:00
David Heinemeier Hansson
439fadf758 Missed a few spots in inline -> async switch 2016-02-05 16:05:48 +01:00
David Heinemeier Hansson
625baa69d1 Change the default adapter from inline to async 2016-02-05 15:35:37 +01:00
Sean Griffin
49f6ce63f3 Preparing for Rails 5.0.0.beta2 2016-02-01 14:37:52 -07:00
Jon Moss
0db5882bb0 Update sucker_punch adapter's description
[ci skip]
2016-01-27 16:07:46 -05:00
Jon Moss
a9a64c490d Update ActiveJob adapter for sucker_punch 2.0
This PR includes two changes for 2.0.0:

- Breaking API change around `async.perform` --> `perform_async`
- New addition of `perform_in`, which now allows end users of the
  adapter to use the `enqueued_at` public API method.
2016-01-27 12:49:35 -05:00
Aaron Patterson
6dfab475ca Merge branch '5-0-beta-sec'
* 5-0-beta-sec:
  bumping version
  fix version update task to deal with .beta1.1
  Eliminate instance level writers for class accessors
  allow :file to be outside rails root, but anything else must be inside the rails view directory
  Don't short-circuit reject_if proc
  stop caching mime types globally
  use secure string comparisons for basic auth username / password
2016-01-25 11:25:11 -08:00
Aaron Patterson
908c011395 bumping version 2016-01-25 10:22:15 -08:00
Santiago Pastorino
4d98b0d837 Merge pull request #22487 from joshsoftware/issue_22413
Added support for bigdecimals in perform_later
2016-01-01 18:58:42 -03:00
Rashmi Yadav
1b608a695c Update copyright notices to 2016 [ci skip] 2015-12-31 18:27:19 +02:00
eileencodes
7eae0bb88e Change alpha to beta1 to prep for release of Rails 5
🎉 🍻
2015-12-18 12:14:09 -05:00
Siva Gollapalli
135258af0b Added support for bigdecimals in perform later 2015-12-03 18:45:55 +05:30
Mike Boone
ece366be07 Fixed wording. 2015-11-08 20:38:13 -05:00
Jerry D'Antonio
23b6f65fd1 Require only necessary concurrent-ruby classes. 2015-11-04 21:12:28 -05:00
Yuki Nishijima
266455cf25 Deprecate exception#original_exception in favor of exception#cause 2015-11-03 06:54:34 -08:00
Matthew Draper
30bacc26f8 Merge pull request #21878 from Gaurav2728/require_monitor
monitor is require for SneakersAdapter
2015-10-10 02:42:11 +10:30
Wojciech Wnętrzak
c2854af747 Added missing specs for not modifying queues when using AJ test helpers 2015-10-07 20:02:15 +02:00
Gaurav Sharma
b0a3a68889 monitor is require for SneakersAdapter
we are using `@monitor = Monitor.new` that inherit from Monitor class, we leave behind this commit https://github.com/rails/rails/commit/cbfc8b36
2015-10-06 10:34:56 +05:30
Yves Senn
c468d7fedd Merge pull request #21854 from morgoth/fix-serializing-at-option-in-aj-matchers
Fixed serializing `:at` option for `assert_eqnueued_with` and `assert_performed_with`
2015-10-05 09:04:13 +02:00
Arthur Nogueira Neves
d2ef471b84 Merge pull request #20116 from cristianbica/activejob-enqueue-logging
ActiveJob - log enqueued message only after the job was successfully enqueued
2015-10-04 20:38:44 -04:00
Wojciech Wnętrzak
6e0254e8d3 Fixed serializing :at option for assert_enqueued_with and assert_performed_with 2015-10-03 15:23:05 +02:00
Wojciech Wnętrzak
8a67c56efb Support passing array to assert_enqueued_jobs in :only option 2015-10-03 13:25:16 +02:00
Wojciech Wnętrzak
3d63e1c155 Do not document private methods in AJ::TestHelper
[CI skip]
2015-10-02 18:19:00 +02:00
Rafael Mendonça França
0f89e15e80 Merge pull request #19425 from wvengen/feature/activejob-priority-master
Add job priorities to ActiveJob
2015-09-25 23:50:33 -03:00
Jerry D'Antonio
56ac6e4768 Replaced ThreadSafe::Map with successor Concurrent::Map.
The thread_safe gem is being deprecated and all its code has been merged
into the concurrent-ruby gem. The new class, Concurrent::Map, is exactly
the same as its predecessor except for fixes to two bugs discovered
during the merge.
2015-09-19 09:56:26 -04:00
wvengen
7059ab35f7 Add job priorities to ActiveJob 2015-09-17 22:17:39 +02:00
Marek Pieczyk
26f37f7c40 Properly log nested parameters to Active Job
Refactor arguments logging method for Active Job
2015-09-08 23:28:12 +02:00
Jerry D'Antonio
25a4155257 Initial implementation of ActiveJob AsyncAdapter. 2015-08-25 14:22:11 -04:00
Rafael Mendonça França
3f866cbdab Fix typo on method name
[Robin Dupret]
2015-08-16 19:28:32 -03:00