[WIP]: streaming interface. One can write nil to the stream to close it.