
                         x    d dl mZmZ d dlmZ d dlmZmZmZm	Z	 d dl
mZ  G d de	e      Z G d d	ee      Zy
)    )abstractmethodABCMeta)Future)ContextManagerMappingUnionAsyncContextManager)	TopicPathc                   N    e Zd ZdZe	 d	deeef   dedede	eef   def
d       Z
y)
AsyncPublisherClientInterfacea  
    An AsyncPublisherClientInterface publishes messages similar to Google Pub/Sub, but must be used in an
    async context. Any publish failures are unlikely to succeed if retried.

    Must be used in an `async with` block or have __aenter__() awaited before use.
    topicdataordering_keyattrsreturnc                    K   t               w)a  
        Publish a message.

        Args:
          topic: The topic to publish to. Publishes to new topics may have nontrivial startup latency.
          data: The bytestring payload of the message
          ordering_key: The key to enforce ordering on, or "" for no ordering.
          **attrs: Additional attributes to send.

        Returns:
          An ack id, which can be decoded using MessageMetadata.decode.

        Raises:
          GoogleApiCallError: On a permanent failure.
        NotImplementedErrorselfr   r   r   r   s        Qlib/third_party/google/cloud/pubsublite/cloudpubsub/publisher_client_interface.pypublishz%AsyncPublisherClientInterface.publish   s     . "##s   N __name__
__module____qualname____doc__r   r   r
   strbytesr   r        r   r   r      sb     
 	$Y^$$ $ 	$
 c"$ 
$ $r#   r   )	metaclassc                   N    e Zd ZdZe	 d
deeef   dedede	eef   ddf
d       Z
y	)PublisherClientInterfacez
    A PublisherClientInterface publishes messages similar to Google Pub/Sub.
    Any publish failures are unlikely to succeed if retried.

    Must be used in a `with` block or have __enter__() called before use.
    r   r   r   r   r   zFuture[str]c                     t               )a   
        Publish a message.

        Args:
          topic: The topic to publish to. Publishes to new topics may have nontrivial startup latency.
          data: The bytestring payload of the message
          ordering_key: The key to enforce ordering on, or "" for no ordering.
          **attrs: Additional attributes to send.

        Returns:
          A future completed with an ack id of type str, which can be decoded using
          MessageMetadata.decode.

        Raises:
          GoogleApiCallError: On a permanent failure.
        r   r   s        r   r   z PublisherClientInterface.publish@   s    0 "##r#   Nr   r   r"   r#   r   r&   r&   8   sb     
 	$Y^$$ $ 	$
 c"$ 
$ $r#   r&   N)abcr   r   concurrent.futuresr   typingr   r   r   r	   google.cloud.pubsublite.typesr
   r   r&   r"   r#   r   <module>r,      s4    ( % F F 3$$77 $D $~  $r#   