Add flush operation.
Merge pull request #142 from EasonLiao/add_sync

Add sync operation.