Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在使用delayed_job gem。
我想使用回调调用一个方法,如下所示
after_update :get_score
如何为此使用 delay_job 以便 get_score 方法在后台运行?
这个怎么样?为我工作。
after_update :get_score private def get_score # code end handle_asynchronously :get_score
我不太熟悉delayed_job,但从它的文档来看,这应该可行。
delayed_job
after_update :obtain_score def get_score # code end private def obtain_score delay.get_score end