|
|
|
|
|
by hbrn
1361 days ago
|
|
What makes it atomic is running publishers and consumers on the same box (since you're sharing filesystem between those). Also listdir is a big bottleneck here: while True:
# get files in outbox
files_in_outbox = [f'{PREFIX}/outbox/{x}' for x in os.listdir(f'{PREFIX}/outbox')]
|
|
It's the move/rename that is atomic.
https://man7.org/linux/man-pages/man2/rename.2.html