Created
November 19, 2016 09:43
-
-
Save ijingo/d563e6e523eabe543c25ae77cd780deb to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func (mr *Master) Register(args *RegisterArgs, _ *struct{}) error { | |
mr.Lock() | |
defer mr.Unlock() | |
debug("Register: worker %s\n", args.Worker) | |
mr.workers = append(mr.workers, args.Worker) | |
go func() { | |
mr.registerChannel <- args.Worker | |
}() | |
return nil | |
} | |
func (mr *Master) Shutdown(_, _ *struct{}) error { | |
debug("Shutdown: registration server\n") | |
close(mr.shutdown) | |
mr.l.Close() | |
return nil | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment