use of io.vertx.up.web.thread.EndPointThread in project vertx-zero by silentbalanceyh.
the class EventInquirer method scan.
@Override
public Set<Event> scan(final Set<Class<?>> endpoints) {
final List<EndPointThread> threadReference = new ArrayList<>();
/**
* 2.1.Build Api metadata *
*/
for (final Class<?> endpoint : endpoints) {
final EndPointThread thread = new EndPointThread(endpoint);
threadReference.add(thread);
thread.start();
}
/**
* 3.2. Join *
*/
Fn.safeJvm(() -> {
for (final EndPointThread item : threadReference) {
item.join();
}
}, LOGGER);
/**
* 3.3. Finally *
*/
final Set<Event> events = new HashSet<>();
Fn.safeJvm(() -> {
for (final EndPointThread item : threadReference) {
events.addAll(item.getEvents());
}
}, LOGGER);
return events;
}
Aggregations