Ë
    üûàg\  ã                   ó>   — d dl mZ ddlmZ ddlmZ  G d„ de«      Zy)é    )ÚAsyncConsumeré   )Úaclose_old_connections)ÚStopConsumerc                   óN   — e Zd ZdZd„ Zdddœd„Zddœd	„Zd
„ Zd„ Zd„ Z	d„ Z
d„ Zy)ÚAsyncHttpConsumerzf
    Async HTTP consumer. Provides basic primitives for building asynchronous
    HTTP endpoints.
    c                 ó   — g | _         y )N)Úbody)ÚselfÚargsÚkwargss      úS/var/www/skyplay_api_hub/venv/lib/python3.12/site-packages/channels/generic/http.pyÚ__init__zAsyncHttpConsumer.__init__   s	   € Øˆ�	ó    éÈ   N)ÚstatusÚheadersc             ƒ   ó¦   K  — |€g }n)t        |t        «      rt        |j                  «       «      }| j	                  d||dœ«      ƒ d{  –—†  y7 Œ­w)a?  
        Sets the HTTP response status and headers. Headers may be provided as
        a list of tuples or as a dictionary.

        Note that the ASGI spec requires that the protocol server only starts
        sending the response to the client after ``self.send_body`` has been
        called the first time.
        Nzhttp.response.start)Útyper   r   )Ú
isinstanceÚdictÚlistÚitemsÚsend)r   r   r   s      r   Úsend_headerszAsyncHttpConsumer.send_headers   sL   è ø€ ð ˆ?Ø‰GÜ˜¤Ô&Ü˜7Ÿ=™=›?Ó+ˆGà�i‰iØ*°fÈÑQó
÷ 	
ò 	
ús   ‚AAÁ	AÁ
AF)Ú	more_bodyc             ƒ   óx   K  — t        |t        «      sJ d«       ‚| j                  d||dœ«      ƒ d{  –—†  y7 Œ­w)a  
        Sends a response body to the client. The method expects a bytestring.

        Set ``more_body=True`` if you want to send more body content later.
        The default behavior closes the response, and further messages on
        the channel will be ignored.
        zBody is not byteszhttp.response.body)r   r
   r   N)r   Úbytesr   )r   r
   r   s      r   Ú	send_bodyzAsyncHttpConsumer.send_body"   s>   è ø€ ô ˜$¤Ô&Ð;Ð(;Ó;Ð&Ø�i‰iØ)°4ÀiÑPó
÷ 	
ò 	
ús   ‚0:²8³:c              ‹   ó~   K  —  | j                   dd|i|¤Žƒ d{  –—†  | j                  |«      ƒ d{  –—†  y7 Œ7 Œ­w)zà
        Sends a response to the client. This is a thin wrapper over
        ``self.send_headers`` and ``self.send_body``, and everything said
        above applies here as well. This method may only be called once.
        r   N© )r   r   )r   r   r
   r   s       r   Úsend_responsezAsyncHttpConsumer.send_response/   sA   è ø€ ð  ˆd×ÑÑ8 vÐ8°Ñ8×8Ð8Ø�n‰n˜TÓ"×"Ñ"ð 	9øØ"ús   ‚=š9›=³;´=»=c              ƒ   ó    K  — t        d«      ‚­w)z·
        Receives the request body as a bytestring. Response may be composed
        using the ``self.send*`` methods; the return value of this method is
        thrown away.
        z?Subclasses of AsyncHttpConsumer must provide a handle() method.)ÚNotImplementedError)r   r
   s     r   ÚhandlezAsyncHttpConsumer.handle8   s   è ø€ ô "ØMó
ð 	
ùs   ‚c              ƒ   ó   K  — y­w)zh
        Overrideable place to run disconnect handling. Do not send anything
        from here.
        Nr!   )r   s    r   Ú
disconnectzAsyncHttpConsumer.disconnectB   s   è ø€ ð
 	ùs   ‚c              ƒ   ó`  K  — d|v r| j                   j                  |d   «       |j                  d«      sU	 | j                  dj	                  | j                   «      «      ƒ d{  –—†  | j                  «       ƒ d{  –—†  t        «       ‚y7 Œ'7 Œ# | j                  «       ƒ d{  –—†7   w xY w­w)z�
        Async entrypoint - concatenates body fragments and hands off control
        to ``self.handle`` when the body has been completely received.
        r
   r   r   N)r
   ÚappendÚgetr%   Újoinr'   r   ©r   Úmessages     r   Úhttp_requestzAsyncHttpConsumer.http_requestI   sŠ   è ø€ ð
 �WÑØ�I‰I×Ñ˜W V™_Ô-Ø�{‰{˜;Ô'ð(Ø—k‘k #§(¡(¨4¯9©9Ó"5Ó6×6Ð6à—o‘oÓ'×'Ð'Ü“.Ð ð (à6øà'ù�d—o‘oÓ'×'Ò'üsL   ‚4B.·-B Á$BÁ%B Á)B.Á<BÁ=B.ÂB ÂB.ÂB+Â$B'Â%B+Â+B.c              ƒ   óz   K  — | j                  «       ƒ d{  –—†  t        «       ƒ d{  –—†  t        «       ‚7 Œ 7 Œ­w)zG
        Let the user do their cleanup and close the consumer.
        N)r'   r   r   r,   s     r   Úhttp_disconnectz!AsyncHttpConsumer.http_disconnectW   s5   è ø€ ð �o‰oÓ×ÐÜ$Ó&×&Ð&Ü‹nÐð 	 øØ&ús   ‚;–7—;¨9©;¹;)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r   r"   r%   r'   r.   r0   r!   r   r   r   r      s;   „ ñò
ð ,/¸ô 
ð$ 27ô 
ò#ò
òò!ór   r   N)Úchannels.consumerr   Údbr   Ú
exceptionsr   r   r!   r   r   ú<module>r8      s   ðÝ +å 'Ý %ôV˜õ Vr   