in src/main/java/com/spotify/google/cloud/pubsub/client/Publisher.java [455:471]
private void sendPending() {
while (outstanding.get() < concurrency) {
final TopicQueue queue = pendingTopics.poll();
if (queue == null) {
return;
}
queue.pending = false;
final int sent = queue.sendBatch();
// Did we send a whole batch? Then there might be more messages in the queue. Mark as pending again.
if (sent == batchSize) {
queue.pending = true;
pendingTopics.offer(queue);
}
}
}