summaryrefslogtreecommitdiff
path: root/doc/classes
diff options
context:
space:
mode:
authorFabio Alessandrelli <fabio.alessandrelli@gmail.com>2019-11-24 13:20:24 +0100
committerFabio Alessandrelli <fabio.alessandrelli@gmail.com>2019-11-24 19:32:20 +0100
commited19b4076e0ec9252202086e65ffcc42510b6cdd (patch)
tree58d0a83b8aa20f96df854259c06743e6dd69ff47 /doc/classes
parent37b230fe3af3c7e20a6f938d03b61a79b117d354 (diff)
Add download_chunk_size property to HTTPRequest.
This allows setting the `read_chunk_size` of the internal HTTPClient. This is important to reduce the allocation overhead and number of file writes when downloading large files, allowing for better download speed.
Diffstat (limited to 'doc/classes')
-rw-r--r--doc/classes/HTTPClient.xml12
-rw-r--r--doc/classes/HTTPRequest.xml4
2 files changed, 7 insertions, 9 deletions
diff --git a/doc/classes/HTTPClient.xml b/doc/classes/HTTPClient.xml
index 52e4b94051..3347eeafa7 100644
--- a/doc/classes/HTTPClient.xml
+++ b/doc/classes/HTTPClient.xml
@@ -170,15 +170,6 @@
Sends the body data raw, as a byte array and does not encode it in any way.
</description>
</method>
- <method name="set_read_chunk_size">
- <return type="void">
- </return>
- <argument index="0" name="bytes" type="int">
- </argument>
- <description>
- Sets the size of the buffer used and maximum bytes to read per iteration. See [method read_response_body_chunk].
- </description>
- </method>
</methods>
<members>
<member name="blocking_mode_enabled" type="bool" setter="set_blocking_mode" getter="is_blocking_mode_enabled" default="false">
@@ -187,6 +178,9 @@
<member name="connection" type="StreamPeer" setter="set_connection" getter="get_connection">
The connection to use for this client.
</member>
+ <member name="read_chunk_size" type="int" setter="set_read_chunk_size" getter="get_read_chunk_size" default="4096">
+ The size of the buffer used and maximum bytes to read per iteration. See [method read_response_body_chunk].
+ </member>
</members>
<constants>
<constant name="METHOD_GET" value="0" enum="Method">
diff --git a/doc/classes/HTTPRequest.xml b/doc/classes/HTTPRequest.xml
index d0e8a5972f..98ba08e6a2 100644
--- a/doc/classes/HTTPRequest.xml
+++ b/doc/classes/HTTPRequest.xml
@@ -93,6 +93,10 @@
<member name="body_size_limit" type="int" setter="set_body_size_limit" getter="get_body_size_limit" default="-1">
Maximum allowed size for response bodies.
</member>
+ <member name="download_chunk_size" type="int" setter="set_download_chunk_size" getter="get_download_chunk_size" default="4096">
+ The size of the buffer used and maximum bytes to read per iteration. See [member HTTPClient.read_chunk_size].
+ Set this to a higher value (e.g. 65536 for 64 KiB) when downloading large files to achieve better speeds at the cost of memory.
+ </member>
<member name="download_file" type="String" setter="set_download_file" getter="get_download_file" default="&quot;&quot;">
The file to download into. Will output any received file into it.
</member>