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

serializable_hash: Jobs should partially define how to as serialize and de-serialize themselves #9924

Closed
wants to merge 1 commit into from

Conversation

jacobo
Copy link

@jacobo jacobo commented Mar 25, 2013

(based on feedback from #9910)

Problem I'm trying to solve:

Users of Rails Q API expect the Q system to be able to serialize and de-serialize the jobs they enQ. If it's unable to do so, it should complain about it with an exact reason, at the time of enQ.

My take:

This problem can't easily be solved exclusively by the framework. Any attempt to do so fully would likely lead to a leaky abstraction wherein Job authors end up digging in to the guts of such an implementation.

Instead, a simple and minimal contract should exist between Job objects and the framework responsible for enQ-ing and running them.

  1. a run method
  2. a serializable_hash method
  3. a from_serializable_hash method

Additionally:

Backend job systems should have a choice on how to serialize jobs. It's fine for Marshal to be the default in Rails, but it's unnecessarily restricting to impose this requirement on all integrators.

@jeremy
Copy link
Member

jeremy commented Mar 25, 2013

Hey @jacobo - there are going to be deeper, more fundamental changes to queueing. I'm thrilled that you're pitching in, but this line of development is a dead end, I'm afraid!

@jeremy jeremy closed this Mar 25, 2013
@jacobo
Copy link
Author

jacobo commented Mar 25, 2013

@jeremy - Are there any other "lines" or approaches you might be able to suggest?

Would you be open to seeing a from-scratch rails 4 Q implementation based on existing resQ or sidekiq conventions?

@steveklabnik
Copy link
Member

We're going back to the drawing board for the API, and it's (tentatively) slated for 4.1.

If you'd like to work on this kind of stuff, we (the Resque team) would love to have you.

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

Successfully merging this pull request may close these issues.

None yet

3 participants