django rest framework - How to execute multiple queue for sequential tasks -
i stucked in case in single or multiplecompany can have multiple users , users can work on resource single user can utilize resource @ once while other have wait. maintain user pending task data in table , check if task state pending using celery function asyncresult
, if pending not spawn other task. next, if task successful query table , fetch pending tasks @ once , put in celery canvas function chain()
execute task in sequence.
i created celery function in django api execute every request, , if task completed deleted task entry table, wrote django signal receiver function post _delete more task same company deleted task belongs.
steps process follow are:
- execute celery function
- if there no task execute task company, created separate queue every company dynamically.
- if other task there store them based on previous task state.
- if task deleted again using signal event check if there other task company task deleted, if there execute them in chain
- so every company initial task execute once api, rest executed signal event.
now worse, when tested scenario 10 users, task executed twice, executed simultaneously. doing wrong, please advise me.
note: chose celery because have multiple companies scenario , users can run task in parallel. resource contention multiple users in single company resources.
Comments
Post a Comment