aboutsummaryrefslogtreecommitdiff
path: root/lib/http/callback_error_handler.go
diff options
context:
space:
mode:
authorShulhan <ms@kilabit.info>2022-03-06 16:16:41 +0700
committerShulhan <ms@kilabit.info>2022-03-06 17:59:27 +0700
commit4dfd8ca2c40f6c904dac5789754020ef28887a7c (patch)
treeed2d541cef7c63ae3ec066feb96603cf41540ef7 /lib/http/callback_error_handler.go
parent6480be9802ac26c603dc55f6bb2f1a447e1a8ca9 (diff)
downloadpakakeh.go-4dfd8ca2c40f6c904dac5789754020ef28887a7c.tar.xz
lib/memfs: changes the DirWatcher and Watcher to use channel
Previously, we use a callback model to propagated changes. This model has its advantages and disadvantages. The advantages is there is no limit of queue when the changes need to be propagated to the caller. The disadvantages of that the watcher needs to wait for callback to finish before continue processing. One can run it under goroutine, but it may cause race if the caller does not handle update properly and it does not guarantee the goroutine process it in FIFO. We can see this on the unit test of NewWatcher, we needs to use sync.WaitGroup to properly check one changes before processing the order. This commit changes the DirWatcher and Watcher to use channel, like the one in time.Ticker.
Diffstat (limited to 'lib/http/callback_error_handler.go')
0 files changed, 0 insertions, 0 deletions