mv retWrite to pubsub.go