calling task inside one task isn't cause issue? #416
-
I have two tasks which are "sync_batch_from_db_to_redis(offset: int = 0, limit: int = 100, batch_size: int = 100)" and "sync_batch_from_redis_to_db(offset: int = 0, limit: int = 100, batch_size: int = 100)". can I call the function itself inside it's own? these functions should sync data from redis to database and wise versa. won't happen rice condition?
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
can I call multiple tasks inside another task? I'm planning to use one distribute_restore_tasks to give workers portion of the data to sync(restore)). so each worker done own portion. I will fetch keys or items count from redis or db and give them to workers. |
Beta Was this translation helpful? Give feedback.
Yes you can do so. Taskiq-pipelines were build using this concept. And actually you might find this plugins useful for your usecase.