MCPcopy Index your code
hub / github.com/grpc/grpc-java / enqueue

Method enqueue

netty/src/main/java/io/grpc/netty/WriteQueue.java:79–91  ·  view source on GitHub ↗

Enqueue a write command on the channel. @param command a write to be executed on the channel. @param flush true if a flush of the write should be schedule, false if a later call to enqueue will schedule the flush.

(QueuedCommand command, boolean flush)

Source from the content-addressed store, hash-verified

77 * enqueue will schedule the flush.
78 */
79 @CanIgnoreReturnValue
80 ChannelFuture enqueue(QueuedCommand command, boolean flush) {
81 // Detect erroneous code that tries to reuse command objects.
82 Preconditions.checkArgument(command.promise() == null, "promise must not be set on command");
83
84 ChannelPromise promise = channel.newPromise();
85 command.promise(promise);
86 queue.add(command);
87 if (flush) {
88 scheduleFlush();
89 }
90 return promise;
91 }
92
93 /**
94 * Enqueue the runnable. It is not safe for another thread to queue an Runnable directly to the

Callers 15

singleWriteShouldWorkMethod · 0.95
pingMethod · 0.45
shutdownMethod · 0.45
shutdownNowMethod · 0.45
writeHeadersMethod · 0.45
writeFrameMethod · 0.45
writeTrailersMethod · 0.45
cancelMethod · 0.45
deframeFailedMethod · 0.45

Calls 4

scheduleFlushMethod · 0.95
promiseMethod · 0.65
addMethod · 0.65
newPromiseMethod · 0.45