etcdserver: add publish func

for #1094 
k. it seems more readable, and it meets jon's expectation too.