PubSub is not finished, but I found a way to implement it robustly and safely