MCPcopy Create free account
hub / github.com/OpenEndedGroup/Field2 / queue

Method queue

src/main/java/fielded/webserver/Server.java:303–326  ·  view source on GitHub ↗
(Callable<T> c)

Source from the content-addressed store, hash-verified

301 CompletableFuture<T> f = new CompletableFuture<>();
302 try {
303 T t = c.call();
304 f.complete(t);
305 } catch (Throwable tt) {
306 f.completeExceptionally(tt);
307 }
308 return f;
309 } else {
310 CompletableFuture<T> f = new CompletableFuture<>();
311 this.queue.add(() -> {
312 try {
313 T t = c.call();
314 f.complete(t);
315 } catch (Throwable tt) {
316 tt.printStackTrace();
317 f.completeExceptionally(tt);
318 }
319 });
320 return f;
321 }
322 }
323
324 public void queue(Runnable c) {
325 this.queue.add(c);
326 }
327
328
329 public void broadcast(String message) {

Callers 4

sendMethod · 0.95
VbFunction · 0.80
onMessageMethod · 0.80

Calls 4

isMainThreadMethod · 0.80
callMethod · 0.45
completeMethod · 0.45
addMethod · 0.45

Tested by

no test coverage detected