1 /* 2 * Copyright 2020 Google LLC 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * https://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 // Generated by the protocol buffer compiler. DO NOT EDIT! 17 // source: google/cloud/tasks/v2/queue.proto 18 19 package com.google.cloud.tasks.v2; 20 21 public interface RateLimitsOrBuilder 22 extends 23 // @@protoc_insertion_point(interface_extends:google.cloud.tasks.v2.RateLimits) 24 com.google.protobuf.MessageOrBuilder { 25 26 /** 27 * 28 * 29 * <pre> 30 * The maximum rate at which tasks are dispatched from this queue. 31 * If unspecified when the queue is created, Cloud Tasks will pick the 32 * default. 33 * * The maximum allowed value is 500. 34 * This field has the same meaning as 35 * [rate in 36 * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#rate). 37 * </pre> 38 * 39 * <code>double max_dispatches_per_second = 1;</code> 40 * 41 * @return The maxDispatchesPerSecond. 42 */ getMaxDispatchesPerSecond()43 double getMaxDispatchesPerSecond(); 44 45 /** 46 * 47 * 48 * <pre> 49 * Output only. The max burst size. 50 * Max burst size limits how fast tasks in queue are processed when 51 * many tasks are in the queue and the rate is high. This field 52 * allows the queue to have a high rate so processing starts shortly 53 * after a task is enqueued, but still limits resource usage when 54 * many tasks are enqueued in a short period of time. 55 * The [token bucket](https://wikipedia.org/wiki/Token_Bucket) 56 * algorithm is used to control the rate of task dispatches. Each 57 * queue has a token bucket that holds tokens, up to the maximum 58 * specified by `max_burst_size`. Each time a task is dispatched, a 59 * token is removed from the bucket. Tasks will be dispatched until 60 * the queue's bucket runs out of tokens. The bucket will be 61 * continuously refilled with new tokens based on 62 * [max_dispatches_per_second][google.cloud.tasks.v2.RateLimits.max_dispatches_per_second]. 63 * Cloud Tasks will pick the value of `max_burst_size` based on the 64 * value of 65 * [max_dispatches_per_second][google.cloud.tasks.v2.RateLimits.max_dispatches_per_second]. 66 * For queues that were created or updated using 67 * `queue.yaml/xml`, `max_burst_size` is equal to 68 * [bucket_size](https://cloud.google.com/appengine/docs/standard/python/config/queueref#bucket_size). 69 * Since `max_burst_size` is output only, if 70 * [UpdateQueue][google.cloud.tasks.v2.CloudTasks.UpdateQueue] is called on a 71 * queue created by `queue.yaml/xml`, `max_burst_size` will be reset based on 72 * the value of 73 * [max_dispatches_per_second][google.cloud.tasks.v2.RateLimits.max_dispatches_per_second], 74 * regardless of whether 75 * [max_dispatches_per_second][google.cloud.tasks.v2.RateLimits.max_dispatches_per_second] 76 * is updated. 77 * </pre> 78 * 79 * <code>int32 max_burst_size = 2;</code> 80 * 81 * @return The maxBurstSize. 82 */ getMaxBurstSize()83 int getMaxBurstSize(); 84 85 /** 86 * 87 * 88 * <pre> 89 * The maximum number of concurrent tasks that Cloud Tasks allows 90 * to be dispatched for this queue. After this threshold has been 91 * reached, Cloud Tasks stops dispatching tasks until the number of 92 * concurrent requests decreases. 93 * If unspecified when the queue is created, Cloud Tasks will pick the 94 * default. 95 * The maximum allowed value is 5,000. 96 * This field has the same meaning as 97 * [max_concurrent_requests in 98 * queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#max_concurrent_requests). 99 * </pre> 100 * 101 * <code>int32 max_concurrent_dispatches = 3;</code> 102 * 103 * @return The maxConcurrentDispatches. 104 */ getMaxConcurrentDispatches()105 int getMaxConcurrentDispatches(); 106 } 107