nsqio / go-diskqueue

A Go package providing a filesystem-backed FIFO queue
MIT License
464 stars 103 forks source link

it'll be better if supports async delete interface #13

Closed vinllen closed 2 years ago

vinllen commented 4 years ago

Since data have been read, the moveForward will call os.Remove to remove the associated file on disk. But in some scenarios, the caller program maybe crashes and restarts, and the data have been read which also means the file may be removed, but the data haven't been applied in the caller. So the data may lost. So, in my point of view, it's better to add an interface to remove old files asynchronously to guarantee atomicity.