flatMap the transform result

so that only one subscription is needed.

Also shutdown the executor on completion.