ruby on rails - Delay job with lambda -
i need send 2 actions background. write :
myobject.delay.action1 myobject.delay.action2
but can't sure action2
starts after action1
finished, can i?
so instead, create method on fly.
def action1and2 myobject.action1 myobject.action2 end myobject.delay.action1and2
but feels stupid create named function meaningless group, doesn't it?
so instead, inspired js, thought of writing lambda:
-> { myobject.action1 myobject.action2 }
can delay such function? or there alternative situation?
myobject.delay.instance_eval { action1; action2 }
Comments
Post a Comment