
    %                         d dl mZmZ d dlmZmZmZmZmZm	Z	m
Z
 d dlmZ d dlmZ d dlmZmZmZ  G d dee      Zeegd	f   Z G d
 dee      Zy	)    )abstractmethodABCMeta)ContextManagerUnionAsyncContextManagerAsyncIteratorCallableOptionalSet)StreamingPullFuture)Message)SubscriptionPathFlowControlSettings	Partitionc                   R    e Zd ZdZe	 ddeeef   dede	e
e      dee   fd       Zy)	AsyncSubscriberClientInterfacea  
    An AsyncSubscriberClientInterface reads messages similar to Google Pub/Sub, but must be used in an
    async context.
    Any subscribe failures are unlikely to succeed if retried.

    Must be used in an `async with` block or have __aenter__() awaited before use.
    Nsubscription#per_partition_flow_control_settingsfixed_partitionsreturnc                    K   t               w)at  
        Read messages from a subscription.

        Args:
          subscription: The subscription to subscribe to.
          per_partition_flow_control_settings: The flow control settings for each partition subscribed to. Note that these
              settings apply to each partition individually, not in aggregate.
          fixed_partitions: A fixed set of partitions to subscribe to. If not present, will instead use auto-assignment.

        Returns:
          An AsyncIterator with Messages that must have ack() called on each exactly once.

        Raises:
          GoogleApiCallError: On a permanent failure.
        NotImplementedError)selfr   r   r   s       Rlib/third_party/google/cloud/pubsublite/cloudpubsub/subscriber_client_interface.py	subscribez(AsyncSubscriberClientInterface.subscribe-   s     , "##s   N)__name__
__module____qualname____doc__r   r   r   strr   r
   r   r   r   r   r        r   r   r   $   s`     
 6:	$,c12$ .A$ #3y>2	$
 
w	$ $r$   r   )	metaclassNc                   P    e Zd ZdZe	 d	deeef   dede	de
ee      def
d       Zy)
SubscriberClientInterfacez
    A SubscriberClientInterface reads messages similar to Google Pub/Sub.
    Any subscribe failures are unlikely to succeed if retried.

    Must be used in a `with` block or have __enter__() called before use.
    Nr   callbackr   r   r   c                     t               )al  
        This method starts a background thread to begin pulling messages from
        a Pub/Sub Lite subscription and scheduling them to be processed using the
        provided ``callback``.

        Args:
          subscription: The subscription to subscribe to.
          callback: The callback function. This function receives the message as its only argument.
          per_partition_flow_control_settings: The flow control settings for each partition subscribed to. Note that these
              settings apply to each partition individually, not in aggregate.
          fixed_partitions: A fixed set of partitions to subscribe to. If not present, will instead use auto-assignment.

        Returns:
          A StreamingPullFuture instance that can be used to manage the background stream.

        Raises:
          GoogleApiCallError: On a permanent failure.
        r   )r   r   r(   r   r   s        r   r   z#SubscriberClientInterface.subscribeQ   s    4 "##r$   r   )r   r   r    r!   r   r   r   r"   MessageCallbackr   r
   r   r   r   r   r#   r$   r   r'   r'   I   se      6:$,c12$ "$ .A	$
 #3y>2$ 
$ $r$   r'   )abcr   r   typingr   r   r   r   r	   r
   r   )google.cloud.pubsub_v1.subscriber.futuresr   )google.cloud.pubsub_v1.subscriber.messager   google.cloud.pubsublite.typesr   r   r   r   r*   r'   r#   r$   r   <module>r0      s\    (   J = $%8G $D G9d?+"$' "$r$   