# This module is commonly used by others in here and should avoid
# taking any unnecessary dependencies back on them.
from deferred_operand import DeferredOperand
# This module is commonly used by others in here and should avoid
# taking any unnecessary dependencies back on them.
from deferred_operand import DeferredOperand
class SmartFuture(DeferredOperand):
"""This is a SmartFuture, a class that wraps a normal Future and can
then be used, mostly, like a normal (non-Future) identifier.
class SmartFuture(DeferredOperand):
"""This is a SmartFuture, a class that wraps a normal Future and can
then be used, mostly, like a normal (non-Future) identifier.
# You shouldn't have to call this; instead, have a look at defining a
# method on DeferredOperand base class.
# You shouldn't have to call this; instead, have a look at defining a
# method on DeferredOperand base class.
def _resolve(self, *, timeout=None) -> T:
return self.wrapped_future.result(timeout)
def _resolve(self, *, timeout=None) -> T:
return self.wrapped_future.result(timeout)