refactor flush and quit channel
Merge pull request #7 from xiangli-cmu/master

refactor flush and quit channel