Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integrate ActiveJob / DeliverLater / GlobalID with Rails #16485

Merged
merged 230 commits into from Aug 17, 2014
Merged

Conversation

@dhh
Copy link
Member

dhh commented Aug 12, 2014

WIP.

dhh and others added 30 commits May 18, 2014
This is not only easier to read, but it'll also properly raise an ArgumentError rather than a NoMethodError when called with no arguments.

It also allocates 4 fewer objects per call (8 down from 12), and is about 50% faster according to a quick benchmark.
Clean up JobWrappers::ResqueWrapper.perform
 Add Sidekiq adapter/wrapper fixes #3
Lazy-load adapters, fixes #6
…l raise exactly the error we want to communicate anyway. Also use the load path, so we can allow plugins, rather than requre_relative
@dhh

This comment has been minimized.

Copy link

dhh commented on activejob/lib/active_job/queue_name.rb in 94ae25e Aug 16, 2014

I'd prefer to leave the default queue name to be 'active_jobs'. 'default' doesn't give you any clue where it came from, and you didn't define it yourself, so you are not expecting it.

@DouweM
Copy link
Contributor

DouweM commented Aug 16, 2014

Not related to the PR itself, but I was wondering: what makes some part of Rails "active_" or "action_"? "Active record" was an existing term of course, but what makes ActionMailer and ActiveJob, action and active, relatively?

@dhh
Copy link
Member Author

dhh commented Aug 16, 2014

I've used Action for anything that is frontend aimed (controller/views), Active for backend (models etc).

On Aug 16, 2014, at 12:20, Douwe Maan notifications@github.com wrote:

Not related to the PR itself, but I was wondering: what makes some part of Rails "active_" or "action_"? "Active record" was an existing term of course, but what makes ActionMailer and ActiveJob, action and active, relatively?


Reply to this email directly or view it on GitHub.

@DouweM
Copy link
Contributor

DouweM commented Aug 16, 2014

All right, curiosity satisfied :)

dhh added a commit that referenced this pull request Aug 17, 2014
Integrate ActiveJob / DeliverLater / GlobalID with Rails
@dhh dhh merged commit 49c9f85 into rails:master Aug 17, 2014
1 check was pending
1 check was pending
continuous-integration/travis-ci The Travis CI build is in progress
Details
@jeremy
Copy link
Member

jeremy commented Aug 18, 2014

🤘

@bf4

This comment has been minimized.

Copy link
Contributor

bf4 commented on 080296b Aug 18, 2014

Hey buddy. Neat looking project, eh?

@chancancode

This comment has been minimized.

Copy link
Member

chancancode commented on b937ea8 Aug 19, 2014

@seuros is this a bug fix? do we need to backport this to 4-1-stable as well? I noticed that it already works as a class method there without this patch, so I'm a bit confused. Do you remember what this was about?

This comment has been minimized.

Copy link
Member

chancancode replied Aug 19, 2014

Backported 😄

06b185c

cc @pixeltrix

This comment has been minimized.

Copy link
Member Author

seuros replied Aug 19, 2014

👍

This comment has been minimized.

Copy link
Member

pixeltrix replied Aug 19, 2014

@seuros @chancancode is there an issue for this ?

This comment has been minimized.

Copy link
Member Author

seuros replied Aug 19, 2014

in 4.1 it's not an actual bug as the mailers are working and calling .register_preview_interceptor will eventually call the instance method. It's not optimal as it creates an ActionMailer::Base instance and tries to render an email
in 4.2 with the introduction of activejob mailer methods are no longer called until it's needed so the tests for register_preview_interceptor started failing and we noticed that bug
@cristianbica

This comment has been minimized.

Copy link
Member

chancancode replied Aug 19, 2014

@pixeltrix nope this was part of the Active Job pull request. I checked that the register_interceptors method is also defined as a class method, so I assumed this is "working by accident" (that it happens to go through method missing, creates an instance and call the same method on it). Feel free to revert or amend if I'm wrong.

This comment has been minimized.

Copy link
Member

pixeltrix replied Aug 20, 2014

@chancancode no, you're right - looks like I missed the class << self when looking at the existing register_interceptors code and it worked by accident.

@cristianbica
Copy link
Member

cristianbica commented Aug 19, 2014

@tenderlove here are the integration tests
#16541

Cristian Bica

On Fri, Aug 15, 2014 at 5:07 AM, Aaron Patterson notifications@github.com
wrote:

Where does the test harness set up redis queues and pg tables for testing
the different queues? I can't seem to find it.


Reply to this email directly or view it on GitHub
#16485 (comment).

@jGRUBBS

This comment has been minimized.

Copy link

jGRUBBS commented on 0c46094 Aug 27, 2014

@mperham why did you remove the later method and raise NIE? I haven't specifically tested this myself, but the later method seems to be appropriate here.

This comment has been minimized.

Copy link
Contributor Author

mperham replied Aug 27, 2014

Find the associated PR and conversation for this commit.

@zhouguangming
Copy link
Contributor

zhouguangming commented Aug 27, 2014

👍

@jGRUBBS
Copy link

jGRUBBS commented Aug 27, 2014

@mperham I am looking at the pull request here rails/activejob#35
I still don't see any rationale behind removing the later method in the sucker_punch_adapter unless you have any reason as to why it was removed, could it be added back?

@cristianbica
Copy link
Member

cristianbica commented Aug 27, 2014

@jGRUBBS it was proposed again in rails/rails #16643 but because Sucker Punch does not have a persistent store we decided not to accept it.

@jGRUBBS
Copy link

jGRUBBS commented Aug 27, 2014

@cristianbica thanks for the explanation, now I see.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

You can’t perform that action at this time.