MCPcopy Create free account
hub / github.com/grpc/grpc-java / complete

Method complete

core/src/main/java/io/grpc/internal/Http2Ping.java:124–140  ·  view source on GitHub ↗

Completes this operation successfully. The stopwatch given during construction is used to measure the elapsed time. Registered callbacks are invoked and provided the measured elapsed time. @return true if the operation is marked as complete; false if it was already complete

()

Source from the content-addressed store, hash-verified

122 * @return true if the operation is marked as complete; false if it was already complete
123 */
124 public boolean complete() {
125 Map<ClientTransport.PingCallback, Executor> callbacks;
126 long roundTripTimeNanos;
127 synchronized (this) {
128 if (completed) {
129 return false;
130 }
131 completed = true;
132 roundTripTimeNanos = this.roundTripTimeNanos = stopwatch.elapsed(TimeUnit.NANOSECONDS);
133 callbacks = this.callbacks;
134 this.callbacks = null;
135 }
136 for (Map.Entry<ClientTransport.PingCallback, Executor> entry : callbacks.entrySet()) {
137 doExecute(entry.getValue(), asRunnable(entry.getKey(), roundTripTimeNanos));
138 }
139 return true;
140 }
141
142 /**
143 * Completes this operation exceptionally. Registered callbacks are invoked and provided the

Calls 4

doExecuteMethod · 0.95
asRunnableMethod · 0.95
getValueMethod · 0.45
getKeyMethod · 0.45