@@ -102,7 +102,7 @@ def publish_update_job_execution(self, request):
102
102
payload = request .to_payload ())
103
103
104
104
def subscribe_to_describe_job_execution_accepted (self , request , on_accepted ):
105
- # type: (DescribeJobExecutionSubscriptionRequest, typing.Callable[[DescribeJobExecutionResponse], None]) -> concurrent.futures.Future
105
+ # type: (DescribeJobExecutionSubscriptionRequest, typing.Callable[[DescribeJobExecutionResponse], None]) -> typing.Tuple[ concurrent.futures.Future, str]
106
106
"""
107
107
API Docs: https://docs.aws.amazon.com/iot/latest/developerguide/jobs-api.html#mqtt-describejobexecution
108
108
@@ -112,9 +112,12 @@ def subscribe_to_describe_job_execution_accepted(self, request, on_accepted):
112
112
The callback should take 1 argument of type `DescribeJobExecutionResponse`.
113
113
The callback is not expected to return anything.
114
114
115
- Returns a concurrent.futures.Future, whose result will be None if the
116
- subscription is successful. The Future's result will be an exception
117
- if the subscription is unsuccessful.
115
+ Returns two values immediately. The first is a `concurrent.futures.Future`
116
+ which will contain a result of `None` when the server has acknowledged
117
+ the subscription, or an exception if the subscription fails. The second
118
+ value is a topic which may be passed to `unsubscribe()` to stop
119
+ receiving messages. Note that messages may arrive before the
120
+ subscription is acknowledged.
118
121
"""
119
122
if not request .thing_name :
120
123
raise ValueError ("request.thing_name is required" )
@@ -130,7 +133,7 @@ def subscribe_to_describe_job_execution_accepted(self, request, on_accepted):
130
133
payload_to_class_fn = DescribeJobExecutionResponse .from_payload )
131
134
132
135
def subscribe_to_describe_job_execution_rejected (self , request , on_rejected ):
133
- # type: (DescribeJobExecutionSubscriptionRequest, typing.Callable[[RejectedError], None]) -> concurrent.futures.Future
136
+ # type: (DescribeJobExecutionSubscriptionRequest, typing.Callable[[RejectedError], None]) -> typing.Tuple[ concurrent.futures.Future, str]
134
137
"""
135
138
API Docs: https://docs.aws.amazon.com/iot/latest/developerguide/jobs-api.html#mqtt-describejobexecution
136
139
@@ -140,9 +143,12 @@ def subscribe_to_describe_job_execution_rejected(self, request, on_rejected):
140
143
The callback should take 1 argument of type `RejectedError`.
141
144
The callback is not expected to return anything.
142
145
143
- Returns a concurrent.futures.Future, whose result will be None if the
144
- subscription is successful. The Future's result will be an exception
145
- if the subscription is unsuccessful.
146
+ Returns two values immediately. The first is a `concurrent.futures.Future`
147
+ which will contain a result of `None` when the server has acknowledged
148
+ the subscription, or an exception if the subscription fails. The second
149
+ value is a topic which may be passed to `unsubscribe()` to stop
150
+ receiving messages. Note that messages may arrive before the
151
+ subscription is acknowledged.
146
152
"""
147
153
if not request .thing_name :
148
154
raise ValueError ("request.thing_name is required" )
@@ -158,7 +164,7 @@ def subscribe_to_describe_job_execution_rejected(self, request, on_rejected):
158
164
payload_to_class_fn = RejectedError .from_payload )
159
165
160
166
def subscribe_to_get_pending_job_executions_accepted (self , request , on_accepted ):
161
- # type: (GetPendingJobExecutionsSubscriptionRequest, typing.Callable[[GetPendingJobExecutionsResponse], None]) -> concurrent.futures.Future
167
+ # type: (GetPendingJobExecutionsSubscriptionRequest, typing.Callable[[GetPendingJobExecutionsResponse], None]) -> typing.Tuple[ concurrent.futures.Future, str]
162
168
"""
163
169
API Docs: https://docs.aws.amazon.com/iot/latest/developerguide/jobs-api.html#mqtt-getpendingjobexecutions
164
170
@@ -168,9 +174,12 @@ def subscribe_to_get_pending_job_executions_accepted(self, request, on_accepted)
168
174
The callback should take 1 argument of type `GetPendingJobExecutionsResponse`.
169
175
The callback is not expected to return anything.
170
176
171
- Returns a concurrent.futures.Future, whose result will be None if the
172
- subscription is successful. The Future's result will be an exception
173
- if the subscription is unsuccessful.
177
+ Returns two values immediately. The first is a `concurrent.futures.Future`
178
+ which will contain a result of `None` when the server has acknowledged
179
+ the subscription, or an exception if the subscription fails. The second
180
+ value is a topic which may be passed to `unsubscribe()` to stop
181
+ receiving messages. Note that messages may arrive before the
182
+ subscription is acknowledged.
174
183
"""
175
184
if not request .thing_name :
176
185
raise ValueError ("request.thing_name is required" )
@@ -184,7 +193,7 @@ def subscribe_to_get_pending_job_executions_accepted(self, request, on_accepted)
184
193
payload_to_class_fn = GetPendingJobExecutionsResponse .from_payload )
185
194
186
195
def subscribe_to_get_pending_job_executions_rejected (self , request , on_rejected ):
187
- # type: (GetPendingJobExecutionsSubscriptionRequest, typing.Callable[[RejectedError], None]) -> concurrent.futures.Future
196
+ # type: (GetPendingJobExecutionsSubscriptionRequest, typing.Callable[[RejectedError], None]) -> typing.Tuple[ concurrent.futures.Future, str]
188
197
"""
189
198
API Docs: https://docs.aws.amazon.com/iot/latest/developerguide/jobs-api.html#mqtt-getpendingjobexecutions
190
199
@@ -194,9 +203,12 @@ def subscribe_to_get_pending_job_executions_rejected(self, request, on_rejected)
194
203
The callback should take 1 argument of type `RejectedError`.
195
204
The callback is not expected to return anything.
196
205
197
- Returns a concurrent.futures.Future, whose result will be None if the
198
- subscription is successful. The Future's result will be an exception
199
- if the subscription is unsuccessful.
206
+ Returns two values immediately. The first is a `concurrent.futures.Future`
207
+ which will contain a result of `None` when the server has acknowledged
208
+ the subscription, or an exception if the subscription fails. The second
209
+ value is a topic which may be passed to `unsubscribe()` to stop
210
+ receiving messages. Note that messages may arrive before the
211
+ subscription is acknowledged.
200
212
"""
201
213
if not request .thing_name :
202
214
raise ValueError ("request.thing_name is required" )
@@ -210,7 +222,7 @@ def subscribe_to_get_pending_job_executions_rejected(self, request, on_rejected)
210
222
payload_to_class_fn = RejectedError .from_payload )
211
223
212
224
def subscribe_to_job_executions_changed_events (self , request , on_event ):
213
- # type: (JobExecutionsChangedSubscriptionRequest, typing.Callable[[JobExecutionsChangedEvent], None]) -> concurrent.futures.Future
225
+ # type: (JobExecutionsChangedSubscriptionRequest, typing.Callable[[JobExecutionsChangedEvent], None]) -> typing.Tuple[ concurrent.futures.Future, str]
214
226
"""
215
227
API Docs: https://docs.aws.amazon.com/iot/latest/developerguide/jobs-api.html#mqtt-jobexecutionschanged
216
228
@@ -220,9 +232,12 @@ def subscribe_to_job_executions_changed_events(self, request, on_event):
220
232
The callback should take 1 argument of type `JobExecutionsChangedEvent`.
221
233
The callback is not expected to return anything.
222
234
223
- Returns a concurrent.futures.Future, whose result will be None if the
224
- subscription is successful. The Future's result will be an exception
225
- if the subscription is unsuccessful.
235
+ Returns two values immediately. The first is a `concurrent.futures.Future`
236
+ which will contain a result of `None` when the server has acknowledged
237
+ the subscription, or an exception if the subscription fails. The second
238
+ value is a topic which may be passed to `unsubscribe()` to stop
239
+ receiving messages. Note that messages may arrive before the
240
+ subscription is acknowledged.
226
241
"""
227
242
if not request .thing_name :
228
243
raise ValueError ("request.thing_name is required" )
@@ -236,7 +251,7 @@ def subscribe_to_job_executions_changed_events(self, request, on_event):
236
251
payload_to_class_fn = JobExecutionsChangedEvent .from_payload )
237
252
238
253
def subscribe_to_next_job_execution_changed_events (self , request , on_event ):
239
- # type: (NextJobExecutionChangedSubscriptionRequest, typing.Callable[[NextJobExecutionChangedEvent], None]) -> concurrent.futures.Future
254
+ # type: (NextJobExecutionChangedSubscriptionRequest, typing.Callable[[NextJobExecutionChangedEvent], None]) -> typing.Tuple[ concurrent.futures.Future, str]
240
255
"""
241
256
API Docs: https://docs.aws.amazon.com/iot/latest/developerguide/jobs-api.html#mqtt-nextjobexecutionchanged
242
257
@@ -246,9 +261,12 @@ def subscribe_to_next_job_execution_changed_events(self, request, on_event):
246
261
The callback should take 1 argument of type `NextJobExecutionChangedEvent`.
247
262
The callback is not expected to return anything.
248
263
249
- Returns a concurrent.futures.Future, whose result will be None if the
250
- subscription is successful. The Future's result will be an exception
251
- if the subscription is unsuccessful.
264
+ Returns two values immediately. The first is a `concurrent.futures.Future`
265
+ which will contain a result of `None` when the server has acknowledged
266
+ the subscription, or an exception if the subscription fails. The second
267
+ value is a topic which may be passed to `unsubscribe()` to stop
268
+ receiving messages. Note that messages may arrive before the
269
+ subscription is acknowledged.
252
270
"""
253
271
if not request .thing_name :
254
272
raise ValueError ("request.thing_name is required" )
@@ -262,7 +280,7 @@ def subscribe_to_next_job_execution_changed_events(self, request, on_event):
262
280
payload_to_class_fn = NextJobExecutionChangedEvent .from_payload )
263
281
264
282
def subscribe_to_start_next_pending_job_execution_accepted (self , request , on_accepted ):
265
- # type: (StartNextPendingJobExecutionSubscriptionRequest, typing.Callable[[StartNextJobExecutionResponse], None]) -> concurrent.futures.Future
283
+ # type: (StartNextPendingJobExecutionSubscriptionRequest, typing.Callable[[StartNextJobExecutionResponse], None]) -> typing.Tuple[ concurrent.futures.Future, str]
266
284
"""
267
285
API Docs: https://docs.aws.amazon.com/iot/latest/developerguide/jobs-api.html#mqtt-startnextpendingjobexecution
268
286
@@ -272,9 +290,12 @@ def subscribe_to_start_next_pending_job_execution_accepted(self, request, on_acc
272
290
The callback should take 1 argument of type `StartNextJobExecutionResponse`.
273
291
The callback is not expected to return anything.
274
292
275
- Returns a concurrent.futures.Future, whose result will be None if the
276
- subscription is successful. The Future's result will be an exception
277
- if the subscription is unsuccessful.
293
+ Returns two values immediately. The first is a `concurrent.futures.Future`
294
+ which will contain a result of `None` when the server has acknowledged
295
+ the subscription, or an exception if the subscription fails. The second
296
+ value is a topic which may be passed to `unsubscribe()` to stop
297
+ receiving messages. Note that messages may arrive before the
298
+ subscription is acknowledged.
278
299
"""
279
300
if not request .thing_name :
280
301
raise ValueError ("request.thing_name is required" )
@@ -288,7 +309,7 @@ def subscribe_to_start_next_pending_job_execution_accepted(self, request, on_acc
288
309
payload_to_class_fn = StartNextJobExecutionResponse .from_payload )
289
310
290
311
def subscribe_to_start_next_pending_job_execution_rejected (self , request , on_rejected ):
291
- # type: (StartNextPendingJobExecutionSubscriptionRequest, typing.Callable[[RejectedError], None]) -> concurrent.futures.Future
312
+ # type: (StartNextPendingJobExecutionSubscriptionRequest, typing.Callable[[RejectedError], None]) -> typing.Tuple[ concurrent.futures.Future, str]
292
313
"""
293
314
API Docs: https://docs.aws.amazon.com/iot/latest/developerguide/jobs-api.html#mqtt-startnextpendingjobexecution
294
315
@@ -298,9 +319,12 @@ def subscribe_to_start_next_pending_job_execution_rejected(self, request, on_rej
298
319
The callback should take 1 argument of type `RejectedError`.
299
320
The callback is not expected to return anything.
300
321
301
- Returns a concurrent.futures.Future, whose result will be None if the
302
- subscription is successful. The Future's result will be an exception
303
- if the subscription is unsuccessful.
322
+ Returns two values immediately. The first is a `concurrent.futures.Future`
323
+ which will contain a result of `None` when the server has acknowledged
324
+ the subscription, or an exception if the subscription fails. The second
325
+ value is a topic which may be passed to `unsubscribe()` to stop
326
+ receiving messages. Note that messages may arrive before the
327
+ subscription is acknowledged.
304
328
"""
305
329
if not request .thing_name :
306
330
raise ValueError ("request.thing_name is required" )
@@ -314,7 +338,7 @@ def subscribe_to_start_next_pending_job_execution_rejected(self, request, on_rej
314
338
payload_to_class_fn = RejectedError .from_payload )
315
339
316
340
def subscribe_to_update_job_execution_accepted (self , request , on_accepted ):
317
- # type: (UpdateJobExecutionSubscriptionRequest, typing.Callable[[UpdateJobExecutionResponse], None]) -> concurrent.futures.Future
341
+ # type: (UpdateJobExecutionSubscriptionRequest, typing.Callable[[UpdateJobExecutionResponse], None]) -> typing.Tuple[ concurrent.futures.Future, str]
318
342
"""
319
343
API Docs: https://docs.aws.amazon.com/iot/latest/developerguide/jobs-api.html#mqtt-updatejobexecution
320
344
@@ -324,9 +348,12 @@ def subscribe_to_update_job_execution_accepted(self, request, on_accepted):
324
348
The callback should take 1 argument of type `UpdateJobExecutionResponse`.
325
349
The callback is not expected to return anything.
326
350
327
- Returns a concurrent.futures.Future, whose result will be None if the
328
- subscription is successful. The Future's result will be an exception
329
- if the subscription is unsuccessful.
351
+ Returns two values immediately. The first is a `concurrent.futures.Future`
352
+ which will contain a result of `None` when the server has acknowledged
353
+ the subscription, or an exception if the subscription fails. The second
354
+ value is a topic which may be passed to `unsubscribe()` to stop
355
+ receiving messages. Note that messages may arrive before the
356
+ subscription is acknowledged.
330
357
"""
331
358
if not request .thing_name :
332
359
raise ValueError ("request.thing_name is required" )
@@ -342,7 +369,7 @@ def subscribe_to_update_job_execution_accepted(self, request, on_accepted):
342
369
payload_to_class_fn = UpdateJobExecutionResponse .from_payload )
343
370
344
371
def subscribe_to_update_job_execution_rejected (self , request , on_rejected ):
345
- # type: (UpdateJobExecutionSubscriptionRequest, typing.Callable[[RejectedError], None]) -> concurrent.futures.Future
372
+ # type: (UpdateJobExecutionSubscriptionRequest, typing.Callable[[RejectedError], None]) -> typing.Tuple[ concurrent.futures.Future, str]
346
373
"""
347
374
API Docs: https://docs.aws.amazon.com/iot/latest/developerguide/jobs-api.html#mqtt-updatejobexecution
348
375
@@ -352,9 +379,12 @@ def subscribe_to_update_job_execution_rejected(self, request, on_rejected):
352
379
The callback should take 1 argument of type `RejectedError`.
353
380
The callback is not expected to return anything.
354
381
355
- Returns a concurrent.futures.Future, whose result will be None if the
356
- subscription is successful. The Future's result will be an exception
357
- if the subscription is unsuccessful.
382
+ Returns two values immediately. The first is a `concurrent.futures.Future`
383
+ which will contain a result of `None` when the server has acknowledged
384
+ the subscription, or an exception if the subscription fails. The second
385
+ value is a topic which may be passed to `unsubscribe()` to stop
386
+ receiving messages. Note that messages may arrive before the
387
+ subscription is acknowledged.
358
388
"""
359
389
if not request .thing_name :
360
390
raise ValueError ("request.thing_name is required" )
0 commit comments