module InstDataShipper module Jobs class AsyncCaller < InstDataShipper::Jobs::Base sidekiq_options retry: 6 if defined?(sidekiq_options) def self.call_from_pool(pool, clazz, method, *args, **kwargs) pool.add_job( job: self, args: [clazz.to_s, method.to_s, *args], kwargs: kwargs, ) end def perform(clazz, method, *args, **kwargs) clazz.constantize.new(executor: self).send(method.to_sym, *args, **kwargs) end end end end