Added shutdown channel usage and monitor goroutine.
Signed-off-by: Robert Xu <robxu9@gmail.com>