class Stream:
Represents a single HTTP/2 Stream.
Stream is a bidirectional flow of bytes within an established connection, which may carry one or more messages. Handles the transfer of HTTP Headers and Data frames.
Role of this class is to 1. Combine all the data frames
Method | __init__ |
No summary |
Method | __str__ |
Undocumented |
Method | _fire_response_deferred |
Builds response from the self._response dict and fires the response deferred callback with the generated response instance |
Method | _get_request_headers |
Undocumented |
Method | check_request_url |
Undocumented |
Method | close |
Based on the reason sent we will handle each case. |
Method | get_response |
Simply return a Deferred which fires when response from the asynchronous request is available |
Method | initiate_request |
Undocumented |
Method | receive_data |
Undocumented |
Method | receive_headers |
Undocumented |
Method | receive_window_update |
Flow control window size was changed. Send data that earlier could not be sent as we were blocked behind the flow control. |
Method | reset_stream |
Close this stream by sending a RST_FRAME to the remote peer |
Method | send_data |
Called immediately after the headers are sent. Here we send all the data as part of the request. |
Instance Variable | _deferred_response |
Undocumented |
Instance Variable | _download_maxsize |
Undocumented |
Instance Variable | _download_warnsize |
Undocumented |
Instance Variable | _protocol |
Undocumented |
Instance Variable | _request |
Undocumented |
Instance Variable | _response |
Undocumented |
Instance Variable | metadata |
Undocumented |
Instance Variable | stream_id |
Undocumented |
Property | _log_warnsize |
Checks if we have received data which exceeds the download warnsize and whether we have not already logged about it. |
Parameters | |
stream_id:int | Undocumented |
request:Request | Undocumented |
protocol:H2ClientProtocol | Undocumented |
download_maxsize:int | Undocumented |
download_warnsize:int | Undocumented |
Parameters | |
reason:StreamCloseReason | Undocumented |
errors:Optional[ | Undocumented |
from_protocol:bool | Undocumented |
Returns | |
Deferred | Undocumented |
Undocumented
Parameters | |
data:bytes | Undocumented |
flow_controlled_length:int | Undocumented |
Parameters | |
reason:StreamCloseReason | Undocumented |
Called immediately after the headers are sent. Here we send all the data as part of the request.
If the content length is 0 initially then we end the stream immediately and wait for response data.