开发者

why can't tasks enqueued during transactions have names?

开发者 https://www.devze.com 2023-01-05 06:40 出处:网络
I just learnt that transactional tasks cannot be named. Why is that? It\'s as though naming a task is an action on a 开发者_StackOverflowdifferent entity group, but \"unnamed\" tasks are actually give

I just learnt that transactional tasks cannot be named. Why is that? It's as though naming a task is an action on a 开发者_StackOverflowdifferent entity group, but "unnamed" tasks are actually given api-generated names.


Task names are unique, so if you add a task named "foo", subsequent adds of tasks named "foo" will fail. This check for uniqueness needs to be done within a transaction itself, so all named tasks in an application would have to have the same entity group.

If you're trying to atomically enqueue tasks within a transaction then the tasks will have to have the same entity group as the other entities in the transaction and uniqueness check would not be reliable.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号