Simplify asynchronous tasks

This commit is contained in:
topjohnwu
2018-08-02 00:41:10 +08:00
parent 075737a4ec
commit 9ac71ff8af
19 changed files with 325 additions and 385 deletions
@@ -81,6 +81,16 @@ public class Topic {
}
}
public static boolean isPublished(@TopicID int... topics) {
for (int topic : topics) {
if (topicList[topic] == null)
return false;
if (!topicList[topic].published)
return false;
}
return true;
}
private static class Store {
boolean published = false;
Set<Subscriber> subscribers = new HashSet<>();