implement pipeline
implement write queue
server::start
fix sample memory leak