brook.promise like implementation on Java