add 'flush' support

Add support to flush every data in cache to disk at maximal speed.
Please no bare excepts!