@@ -322,14 +322,14 @@ def spin_until_future_complete(
322
322
323
323
if timeout_sec is None or timeout_sec < 0 :
324
324
while self ._context .ok () and not future .done () and not self ._is_shutdown :
325
- self .spin_once_until_future_complete (future , timeout_sec )
325
+ self ._spin_once_until_future_complete (future , timeout_sec )
326
326
else :
327
327
start = time .monotonic ()
328
328
end = start + timeout_sec
329
329
timeout_left = TimeoutObject (timeout_sec )
330
330
331
331
while self ._context .ok () and not future .done () and not self ._is_shutdown :
332
- self .spin_once_until_future_complete (future , timeout_left )
332
+ self ._spin_once_until_future_complete (future , timeout_left )
333
333
now = time .monotonic ()
334
334
335
335
if now >= end :
@@ -367,6 +367,13 @@ def spin_once_until_future_complete(
367
367
"""
368
368
raise NotImplementedError ()
369
369
370
+ def _spin_once_until_future_complete (
371
+ self ,
372
+ future : Future ,
373
+ timeout_sec : Optional [Union [float , TimeoutObject ]] = None
374
+ ) -> None :
375
+ raise NotImplementedError ()
376
+
370
377
def _take_timer (self , tmr ):
371
378
try :
372
379
with tmr .handle :
@@ -852,13 +859,20 @@ def _spin_once_impl(
852
859
def spin_once (self , timeout_sec : Optional [float ] = None ) -> None :
853
860
self ._spin_once_impl (timeout_sec )
854
861
862
+ def _spin_once_until_future_complete (
863
+ self ,
864
+ future : Future ,
865
+ timeout_sec : Optional [Union [float , TimeoutObject ]] = None
866
+ ) -> None :
867
+ self ._spin_once_impl (timeout_sec , future .done )
868
+
855
869
def spin_once_until_future_complete (
856
870
self ,
857
871
future : Future ,
858
872
timeout_sec : Optional [Union [float , TimeoutObject ]] = None
859
873
) -> None :
860
874
future .add_done_callback (lambda x : self .wake ())
861
- self ._spin_once_impl ( timeout_sec , future . done )
875
+ self ._spin_once_until_future_complete ( future , timeout_sec )
862
876
863
877
864
878
class MultiThreadedExecutor (Executor ):
@@ -924,13 +938,20 @@ def _spin_once_impl(
924
938
def spin_once (self , timeout_sec : Optional [float ] = None ) -> None :
925
939
self ._spin_once_impl (timeout_sec )
926
940
941
+ def _spin_once_until_future_complete (
942
+ self ,
943
+ future : Future ,
944
+ timeout_sec : Optional [Union [float , TimeoutObject ]] = None
945
+ ) -> None :
946
+ self ._spin_once_impl (timeout_sec , future .done )
947
+
927
948
def spin_once_until_future_complete (
928
949
self ,
929
950
future : Future ,
930
951
timeout_sec : Optional [Union [float , TimeoutObject ]] = None
931
952
) -> None :
932
953
future .add_done_callback (lambda x : self .wake ())
933
- self ._spin_once_impl ( timeout_sec , future . done )
954
+ self ._spin_once_until_future_complete ( future , timeout_sec )
934
955
935
956
def shutdown (
936
957
self ,
0 commit comments