
                             d dl mZ d dlZd dlmZmZmZ d dlZ	 G d dej                  j                  e	j                  j                  j                        Zy)    )absolute_importN)AnyNoReturnOptionalc                   V     e Zd ZdZdefdZdefdZdef fdZ	de
e   f fdZ xZS )	Futurea#  Encapsulation of the asynchronous execution of an action.

    This object is returned from asychronous Pub/Sub calls, and is the
    interface to determine the status of those calls.

    This object should not be created directly, but is returned by other
    methods in this library.
    returnc                 $    | j                          S )zGReturn ``True`` if the associated Pub/Sub action has not yet completed.)doneselfs    1lib/third_party/google/cloud/pubsub_v1/futures.pyrunningzFuture.running!   s    99;    c                     t        d      )Nz9Only used by executors from `concurrent.futures` package.)NotImplementedErrorr   s    r   set_running_or_notify_cancelz#Future.set_running_or_notify_cancel%   s    !G
 	
r   resultc                 $    t         |   |      S )zSet the return value of work associated with the future.

        Do not use this method, it should only be used internally by the library and its
        unit tests.
        )r   )super
set_result)r   r   	__class__s     r   r   zFuture.set_result*   s     w!!00r   	exceptionc                 $    t         |   |      S )zSet the result of the future as being the given exception.

        Do not use this method, it should only be used internally by the library and its
        unit tests.
        )r   )r   set_exception)r   r   r   s     r   r   zFuture.set_exception2   s     w$y$99r   )__name__
__module____qualname____doc__boolr   r   r   r   r   r   BaseExceptionr   __classcell__)r   s   @r   r   r      sB     
h 

1 1:x'> : :r   r   )
__future__r   concurrent.futures
concurrenttypingr   r   r   google.api_core.futuregooglefuturesr   api_corefuture r   r   <module>r-      s@    '  * * !:Z&&(>(>(E(E !:r   