
    	                     h    d dl mZmZ d dl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)AsyncContextManagerMappingContextManager)futuresc            
       @    e Zd ZdZe	 ddededeeef   defd       Zy)	AsyncSinglePublisherz
    An AsyncPublisher publishes messages similar to Google Pub/Sub, but must be used in an
    async context. Any publish failures are permanent.

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

        Args:
          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   s       Plib/third_party/google/cloud/pubsublite/cloudpubsub/internal/single_publisher.pypublishzAsyncSinglePublisher.publish   s     $ "##s   N 	__name__
__module____qualname____doc__r   bytesstrr   r        r   r
   r
      sG     /1$$),$<CCH<M$	$ $r    r
   )	metaclassc            
       @    e Zd ZdZe	 d	dededeeef   ddfd       Zy)
SinglePublisherz
    A Publisher publishes messages similar to Google Pub/Sub. Any publish failures are permanent.

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

        Args:
          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, which can be decoded using MessageMetadata.decode.

        Raises:
          GoogleApiCallError: On a permanent failure.
        r   r   s       r   r   zSinglePublisher.publish8   s    $ "##r    Nr   r   r   r    r   r#   r#   1   sG     /1$$),$<CCH<M$	$ $r    r#   N)abcr   r   typingr   r   r   
concurrentr   r
   r#   r   r    r   <module>r(      s0    ( ? ? $.' $:$n $r    