ruby - how to make resque process jobs ordered -
i have queue process 'products' thar sent via json. receive them in order {1, 2, 3, 4}, resque processed them in {1, 3, 2, 4}. pretty important resque process ordered because old version of product can override new version thar processed
there way tell resque process {job} orderede {job.field_i_want}?
edit: code enqueue job
def produto if params[:json] # upload = params[:json] # content = upload.read # parsed_json = json(content) parsed_json = json(params[:json]) parsed_json['idfila'] = params[:idfila] logger.info parsed_json resque.enqueue(produtoworker, parsed_json) render json: activesupport::json.encode(retorno.new(:status => "ok", :mensagem => "produto recebido")), :status => :ok else render json: activesupport::json.encode(retorno.new(:status => "erro", :mensagem => "sem json")), :status => :not_found end rescue => exception render json: activesupport::json.encode(retorno.new(:status => "erro", :mensagem => "#{exception}")), :status => :error end #produto
resque processes jobs in order queued, can post code enqueue jobs?
Comments
Post a Comment