You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
chapter 13. Danger of using single UOW instance. #312
The message bus keeps using a single UOW instance.
This is not a problem if all messages are handled by a single thread.
However, on a multi-threading environment where each api request may be handled by different concurrent thread, there is possibility of losing events before events are collected to the queue in the message bus.
Found this problem while developing a GRPC server which is multi-threaded by default.
I fixed this issue by making message bus to keep a UOW instance generator function instead of the UOW instance.
You're quite right! I have a long-standing action to write a blog post about this and add a footnote to the book.
there's some existing discussion here if you're interested. cosmicpython/code#23 thanks for opening the issue here too tho. hope other people will find it too!
Activity
hjwp commentedon Sep 16, 2020
You're quite right! I have a long-standing action to write a blog post about this and add a footnote to the book.
there's some existing discussion here if you're interested. cosmicpython/code#23 thanks for opening the issue here too tho. hope other people will find it too!
dbaber commentedon May 4, 2024
@donguklim What does your "UOW instance generator function" look like?