{"comment":{"url":"https://api.github.com/repos/katjoyce/certificate-transparency/comments/15733504","html_url":"https://github.com/katjoyce/certificate-transparency/commit/f708139b4347193f7a75be1bc8d1b5520b210e22#commitcomment-15733504","id":15733504,"user":{"login":"katjoyce","id":5446167,"avatar_url":"https://avatars.githubusercontent.com/u/5446167?v=3","gravatar_id":"","url":"https://api.github.com/users/katjoyce","html_url":"https://github.com/katjoyce","followers_url":"https://api.github.com/users/katjoyce/followers","following_url":"https://api.github.com/users/katjoyce/following{/other_user}","gists_url":"https://api.github.com/users/katjoyce/gists{/gist_id}","starred_url":"https://api.github.com/users/katjoyce/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/katjoyce/subscriptions","organizations_url":"https://api.github.com/users/katjoyce/orgs","repos_url":"https://api.github.com/users/katjoyce/repos","events_url":"https://api.github.com/users/katjoyce/events{/privacy}","received_events_url":"https://api.github.com/users/katjoyce/received_events","type":"User","site_admin":false},"position":88,"line":88,"path":"go/fixchain/fixer.go","commit_id":"f708139b4347193f7a75be1bc8d1b5520b210e22","created_at":"2016-01-28T14:08:31Z","updated_at":"2016-01-28T14:08:31Z","body":"Part of the reason it is async currently is that the next chunk to add is a Logger that then takes the fixed chains and logs them to one of the CT logs.  It reads the fixed chains from the chains channel, so it can begin logging chains as soon as the first ones have been fixed and put on the channel, rather than having to wait until all of the chains have been fixed by the Fixer before beginning its work.  Similarly for the ErrorHandler piece.\r\n\r\nThe caller would then do something like,\r\n\r\nf := NewFixer(... chains chan ...)\r\nl := NewLogger(... chains chan ...)\r\nf.QueueChains(chains)  // Admittedly this function could have a better name for the API\r\nf.Wait()\r\nl.Wait()"}}