import rx.subject : SubjectObject; auto sub = new SubjectObject!int; bool result = false; sub.any!("a % 2 == 0").doSubscribe((bool) { result = true; }); assert(result == false); sub.put(1); assert(result == false); sub.put(0); assert(result == true);