naive implementation of pub, sub, and poll