Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
func newRunner(creds) {
githubClient: newGithubClient(creds),
githubCredentials: creds,
// Note: buffered channel. Means that writes to `builds` will almost always return immediately,
// unless we accumulate 100 builds in the queue. We don't have a good failure mode if that happens.
// That's OK for now.
builds: make(chan *event, 100),
func main() {
runner := newRunner()
// background goroutine for doing one build at a time.
go runner.startBuilder()
for event := range server.Events {
// this returns almost immediately
func (r *runner) startBuilder() {
// Only one thing happening at a time here.
for event := range r.builds {
// etc.
func (r *runner) handleEvent(event) {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.