You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
PerformableMethod has a reader method #method which overrides Object#method.
Normally, this is not a problem, but if you mixin a failure hook into the PerformableMethod class, when the hook procedure tries to call Object#method on the payload_object (to determine it's arity), it raises a NameError when the payload object is a PerformableMethod.
I know that augmenting PerformableMethod isn't really part of the API, but I imagine that you're planning on adding an interface for adding failure hooks for method.delay, since creating a custom job class for every method you desire to have a failure hook is a little cumbersome.
I had a branch cooking that fixed the issue by renaming PerformableMethod#method to #delayed_method (overriding the core #method was a poor choice IMHO), and was starting on an API for adding custom failure methods via inline Procs or Modules: method.delay(:failure => lambda {}).method(args)
However, you have been busy recently! delayed_job is undergoing a major overhaul and my branch has become a mess to integrate. So instead of trying to read your mind, I'd like to ask if you could resolve this issue.
The text was updated successfully, but these errors were encountered:
I was hoping to implement the inline #failure Proc, but I didn't see an obvious way to get around the fact that Procs aren't serializable. Specifying a module: object.delay(:failure => MyFailureModule).method could work by simply extending the payload_object with the module after deserializing it.
Also, note that renaming PerformableMethod#method breaks the backend specs, or at least they did while I was trying to fix them in this branch:
PerformableMethod has a reader method #method which overrides Object#method.
Normally, this is not a problem, but if you mixin a failure hook into the PerformableMethod class, when the hook procedure tries to call Object#method on the payload_object (to determine it's arity), it raises a NameError when the payload object is a PerformableMethod.
I know that augmenting PerformableMethod isn't really part of the API, but I imagine that you're planning on adding an interface for adding failure hooks for
method.delay
, since creating a custom job class for every method you desire to have a failure hook is a little cumbersome.I had a branch cooking that fixed the issue by renaming PerformableMethod#method to #delayed_method (overriding the core #method was a poor choice IMHO), and was starting on an API for adding custom failure methods via inline Procs or Modules:
method.delay(:failure => lambda {}).method(args)
However, you have been busy recently! delayed_job is undergoing a major overhaul and my branch has become a mess to integrate. So instead of trying to read your mind, I'd like to ask if you could resolve this issue.
The text was updated successfully, but these errors were encountered: