allow different types of res_iter

Currently WSAPI accepts only function iterator as res_iter. This forces WSAPI frameworks and applications writers to return function iterator from their `run()`.