python - Celery add tasks to queue when ready -


I am new to celery I am trying to do a distributed function with celery

Let's say that I have any job in my work file task.py :

  @ celery.task dff gener_sorts (params, meta_data_dict): '' 'This will generate some type' '' pass   

and I am doing the following as part of some distributed resources:

  taskset = TaskSet (tasks.generate_sorts.subtask (args = (Params, meta_data_dict)) Meta_Data_Disk Chunk_generator for print) Print "Task Disclosure" taskset_result = taskset.apply_async () Print "Waiting for results" Results = WorkComedia_Salt. Join_native () Print "Result:" Process # Results   

Now the chunk_generator basically fetches a generator pattern which goes to the database and some metadata. My problem is that these work gets deposited before the work queue is already sent. In fact, before generating in the queue, my generator takes about 30 minutes to fetch all meta data. I know how it works for TaskSet i TaskSet I'm looking for some alternative, that is, I will be able to do the equivalent in the distributed way below.

  pool.imap_unordered (gener_sorts, chunk_generator)   

The above gener_sots will display as soon as a generator generates results. In other words, there is anything optional for TaskSet , where I can get a job from the generator for the first time, before the generator can bring everything to the generator instead of waiting to get it, before That I can start some work.

You try to start them immediately and try to add examples as a result of asyncResult Should: A:

  result result from result of sales_set = ResultSet () chunk_generator in the meta_data_choice: select the job immediately in the # queue result = task.generate_sorts.delay (params, meta_data_dict) result_set Results (results) Print "Waiting for result" result = result_set.join_native () print "results:" take action on # result    

Comments

Popular posts from this blog

php - PDO bindParam() fatal error -

logging - How can I log both the Request.InputStream and Response.OutputStream traffic in my ASP.NET MVC3 Application for specific Actions? -

java - Why my included JSP file won't get processed correctly? -