
    )                     b    d dl Z d dlmZ d dlmZ d dlmZ d dlmZm	Z	 d dl
mZ  G d de      Zy)	    N)Mapping)	Publisher)RoutingPolicy)	PartitionMessageMetadata)PubSubMessagec                   b    e Zd ZU eed<   eeef   ed<   dedeeef   fdZd Z	d Z
ded	efd
Zy)RoutingPublisher_routing_policy_publishersrouting_policy
publishersc                      || _         || _        y N)r   r   )selfr   r   s      Jlib/third_party/google/cloud/pubsublite/internal/wire/routing_publisher.py__init__zRoutingPublisher.__init__   s      .%    c                    K   | j                   j                         D cg c]  }|j                          }}t        j                  |  d {    | S c c}w 7 wr   )r   values
__aenter__asynciogather)r   	publisherenter_futuress      r   r   zRoutingPublisher.__aenter__"   s^     484D4D4K4K4M
4MyI  "4M 	 
 nnm,,,	
 	-s   AAAAAc                    K   | j                   j                         D ]  }|j                  |||       d {     y 7 wr   )r   r   	__aexit__)r   exc_typeexc_valexc_tbr   s        r   r   zRoutingPublisher.__aexit__)   s:     ))002I%%h@@@ 3@s   4A >A messagereturnc                    K   | j                   j                  |      }|| j                  v sJ | j                  |   j                  |       d {   S 7 wr   )r   router   publish)r   r!   	partitions      r   r%   zRoutingPublisher.publish-   sR     ((..w7	D,,,,,%%i088AAAAs   AAAAN)__name__
__module____qualname__r   __annotations__r   r   r   r   r   r   r   r   r%    r   r   r
   r
      sX    ""I-..&+&9@IAU9V&AB] B Br   r
   )r   typingr   /google.cloud.pubsublite.internal.wire.publisherr   4google.cloud.pubsublite.internal.wire.routing_policyr   google.cloud.pubsublite.typesr   r   google.cloud.pubsublite_v1r   r
   r+   r   r   <module>r1      s'      E N D 4By Br   