django - celery received tasks and execute it step by step (Singleton) -


in django project celery, have celery task function needs received incoming tasks starts step step singleton.

i can like:

@shared_task(bind=true) def make_some_task(self, event_id):     lock_name = os.path.join(settings.base_dir, 'create_lock')     is_exists = os.path.exists(lock_name)     while is_exists:         time.sleep(10)      open('create_lock', 'w') file:         file.write('locked')      ..... staff.....     os.remove(lock_name) 

but think not correct way use inside celery, think must better way implement


Comments

Popular posts from this blog

PHP and MySQL WP -

android - InAppBilling registering BroadcastReceiver in AndroidManifest -

go - golang pprof for c library code -