fix #250, refactor stream replay api and impl