@@ -77,64 +77,6 @@ public static ListOption pageToken(String pageToken) {
77
77
}
78
78
}
79
79
80
- /** Class for specifying options for pulling messages. */
81
- final class PullOption extends Option {
82
-
83
- private static final long serialVersionUID = 4792164134340316582L ;
84
-
85
- enum OptionType implements Option .OptionType {
86
- EXECUTOR_FACTORY ,
87
- MAX_QUEUED_CALLBACKS ;
88
-
89
- @ SuppressWarnings ("unchecked" )
90
- <T > T get (Map <Option .OptionType , ?> options ) {
91
- return (T ) options .get (this );
92
- }
93
-
94
- Integer getInteger (Map <Option .OptionType , ?> options ) {
95
- return get (options );
96
- }
97
-
98
- ExecutorFactory <ExecutorService > getExecutorFactory (Map <Option .OptionType , ?> options ) {
99
- return get (options );
100
- }
101
- }
102
-
103
- private PullOption (Option .OptionType option , Object value ) {
104
- super (option , value );
105
- }
106
-
107
- /**
108
- * Returns an option to specify the maximum number of messages that can be queued in the message
109
- * consumer at any time. Queued messages are already pulled messages that are either waiting to
110
- * be processed or being processed. Queued messages will have their acknowledge deadline renewed
111
- * until they are acknowledged or "nacked". If not provided, at most 100 messages can be in the
112
- * queue.
113
- */
114
- public static PullOption maxQueuedCallbacks (int maxQueuedCallbacks ) {
115
- return new PullOption (OptionType .MAX_QUEUED_CALLBACKS , maxQueuedCallbacks );
116
- }
117
-
118
- /**
119
- * Returns an option to specify the executor used to execute message processor callbacks. The
120
- * executor determines the number of messages that can be processed at the same time. If not
121
- * provided, a single-threaded executor is used to execute message processor callbacks.
122
- *
123
- * <p>The {@link ExecutorFactory} object can be used to handle creation and release of the
124
- * executor, possibly reusing existing executors. {@link ExecutorFactory#get()} is called when
125
- * the message consumer is created. {@link ExecutorFactory#release(ExecutorService)} is called
126
- * when the message consumer is closed.
127
- *
128
- * <p>For the created option to be serializable, the provided executor factory should implement
129
- * {@link java.io.Serializable}.
130
- *
131
- * @param executorFactory the executor factory.
132
- */
133
- public static PullOption executorFactory (ExecutorFactory executorFactory ) {
134
- return new PullOption (OptionType .EXECUTOR_FACTORY , executorFactory );
135
- }
136
- }
137
-
138
80
/**
139
81
* Creates a new topic.
140
82
*
0 commit comments