GODT-213: Add comments for newly added code

This commit is contained in:
James Houlahan
2021-03-25 10:00:08 +01:00
parent 50550d42b4
commit ef6a3d4999
6 changed files with 31 additions and 0 deletions

View File

@ -56,6 +56,12 @@ func newFetchResFailure(req fetchReq, err error) fetchRes {
}
}
// startFetchWorkers starts the given number of fetch workers.
// These workers download message and attachment data from API.
// Each fetch worker will use up to the given number of attachment workers to download attachments.
// Two channels are returned:
// - fetchReqCh: used to send work items to the worker pool
// - fetchResCh: used to receive work results from the worker pool
func startFetchWorkers(fetchWorkers, attachWorkers int) (chan fetchReq, chan fetchRes) {
fetchReqCh := make(chan fetchReq)
fetchResCh := make(chan fetchRes)