ó
    ?�‘h\  ã                   ó>   • S SK Jr  SSKJr  SSKJr   " S S\5      rg)é    )ÚAsyncConsumeré   )Úaclose_old_connections)ÚStopConsumerc                   óZ   • \ rS rSrSrS rSSS.S jrSS	.S
 jrS rS r	S r
S rS rSrg)ÚAsyncHttpConsumeré   zZ
Async HTTP consumer. Provides basic primitives for building asynchronous
HTTP endpoints.
c                 ó   • / U l         g )N©Úbody)ÚselfÚargsÚkwargss      ÚYC:\Users\psant\Downloads\Noiseback\school\venv\Lib\site-packages\channels/generic/http.pyÚ__init__ÚAsyncHttpConsumer.__init__   s	   € Øˆ�	ó    éÈ   N)ÚstatusÚheadersc             ƒ   ó°   #   • Uc  / nO.[        U[        5      (       a  [        UR                  5       5      nU R	                  SXS.5      I Sh  v•N   g N7f)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_headersÚAsyncHttpConsumer.send_headers   sL   é € ð ‰?Ø‰GÜ˜¤×&Ñ&Ü˜7Ÿ=™=›?Ó+ˆGà�i‰iØ*°fÑQó
÷ 	
ó 	
ùs   ‚AAÁAÁAF)Ú	more_bodyc             ƒ   ó€   #   • [        U[        5      (       d   S5       eU R                  SXS.5      I Sh  v•N   g N7f)zë
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_bodyÚAsyncHttpConsumer.send_body"   s>   é € ô ˜$¤×&Ñ&Ð;Ð(;Ó;Ð&Ø�i‰iØ)°4ÑPó
÷ 	
ó 	
ùs   ‚4>¶<·>c              ‹   ó~   #   • U R                   " SSU0UD6I Sh  v•N   U R                  U5      I Sh  v•N   g N N7f)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_responseÚAsyncHttpConsumer.send_response/   s=   é € ð ×ÒÑ8 vÐ8°Ñ8×8Ð8Ø�n‰n˜TÓ"×"Ñ"ñ 	9Ù"ùs   ‚=š9›=³;´=»=c              ƒ   ó    #   • [        S5      e7f)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   ÚhandleÚAsyncHttpConsumer.handle8   s   é € ô "ØMó
ð 	
ùs   ‚c              ƒ   ó   #   • g7f)zP
Overrideable place to run disconnect handling. Do not send anything
from here.
Nr&   )r   s    r   Ú
disconnectÚAsyncHttpConsumer.disconnectB   s
   é € ð
 	ùs   ‚c              ƒ   ón  #   • SU;   a  U R                   R                  US   5        UR                  S5      (       dU   U R                  SR	                  U R                   5      5      I Sh  v•N   U R                  5       I Sh  v•N   [        5       eg N' N! U R                  5       I Sh  v•N    f = f7f)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_requestÚ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   ‚;B5¾-B Á+BÁ,B Á0B5ÂBÂB5ÂB ÂB5ÂB2Â+B.Â,B2Â2B5c              ƒ   óz   #   • U R                  5       I Sh  v•N   [        5       I Sh  v•N   [        5       e N  N7f)z7
Let the user do their cleanup and close the consumer.
N)r.   r   r   r4   s     r   Úhttp_disconnectÚ!AsyncHttpConsumer.http_disconnectW   s3   é € ð �o‰oÓ×ÐÜ$Ó&×&Ð&Ü‹nÐñ 	 Ù&ùs   ‚;–7—;¨9©;¹;r   )Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r   r   r#   r'   r+   r.   r6   r9   Ú__static_attributes__r&   r   r   r   r      s;   † ñò
ð ,/¸õ 
ð$ 27õ 
ò#ò
òò!õr   r   N)Úchannels.consumerr   Údbr   Ú
exceptionsr   r   r&   r   r   Ú<module>rD      s   ðÝ +å 'Ý %ôV˜õ Vr   