This is an automated email from the ASF dual-hosted git repository.

Xuanwo pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/opendal.git


The following commit(s) were added to refs/heads/main by this push:
     new b5db300286 docs(core): state that concurrent 0 behaves like 1 (#9412)
b5db300286 is described below

commit b5db300286b137e15e25c2c3ccdfbd7f9cdd18e1
Author: Chitral Verma <[email protected]>
AuthorDate: Mon Nov 30 06:56:29 2026 +0530

    docs(core): state that concurrent 0 behaves like 1 (#9412)
    
    * docs(core): state that concurrent 0 behaves like 1
    
    Signed-off-by: Chitral Verma <[email protected]>
    
    * fixup! docs(core): state that concurrent 0 behaves like 1
    
    Scope the parallel-write bullet to concurrent above 1 and add the rule
    to the read_with and reader_with builder docs.
    
    Signed-off-by: Chitral Verma <[email protected]>
    
    ---------
    
    Signed-off-by: Chitral Verma <[email protected]>
---
 bindings/c/include/opendal.h                     | 16 ++++++++++++----
 bindings/c/src/options.rs                        | 16 ++++++++++++----
 bindings/cpp/include/options.hpp                 | 12 ++++++++----
 bindings/go/options.go                           |  8 ++++++--
 bindings/nodejs/generated.d.ts                   |  5 ++++-
 bindings/nodejs/src/options/read.rs              |  1 +
 bindings/nodejs/src/options/reader.rs            |  1 +
 bindings/nodejs/src/options/write.rs             |  3 ++-
 bindings/python/python/opendal/options.py        |  4 +++-
 bindings/python/src/options/generated.rs         |  4 +++-
 core/core/src/types/operator/operator_futures.rs |  2 ++
 core/core/src/types/options.rs                   |  8 ++++++--
 dev/src/generate/nodejs.rs                       |  6 +++---
 13 files changed, 63 insertions(+), 23 deletions(-)

diff --git a/bindings/c/include/opendal.h b/bindings/c/include/opendal.h
index c6e44fefe8..1558d032ad 100644
--- a/bindings/c/include/opendal.h
+++ b/bindings/c/include/opendal.h
@@ -587,7 +587,8 @@ typedef struct opendal_write_options {
    * ## Behavior
    *
    * - By default, OpenDAL writes files sequentially
-   * - When concurrent is set:
+   * - `0` has the same behavior as `1`
+   * - When concurrent is greater than `1`:
    *   - Multiple write operations can execute in parallel
    *   - Write operations return immediately without waiting if tasks space 
are available
    *   - Close operation ensures all writes complete in order
@@ -865,6 +866,7 @@ typedef struct opendal_read_options {
    *
    * By setting `concurrent`, opendal will fetch chunks concurrently with
    * the given chunk size. Without `chunk`, OpenDAL does not read concurrently.
+   * `0` has the same behavior as `1`.
    *
    * `0` is the default.
    */
@@ -1135,6 +1137,7 @@ typedef struct opendal_reader_options {
    * By setting `concurrent`, opendal will fetch chunks concurrently with
    * the given chunk size. Without `chunk`, a reader from
    * `opendal_operator_reader_with()` does not read concurrently.
+   * `0` has the same behavior as `1`.
    *
    * `0` is the default.
    */
@@ -1614,7 +1617,8 @@ typedef struct opendal_copy_options {
    * the copier from `opendal_operator_copier_with()`.
    *
    * This is a best-effort execution option. Services that cannot split copy
-   * into concurrent server-side tasks can ignore it.
+   * into concurrent server-side tasks can ignore it. `0` has the same
+   * behavior as `1`.
    *
    * `0` is the default.
    */
@@ -4476,6 +4480,7 @@ void opendal_read_options_set_if_unmodified_since(struct 
opendal_read_options *o
  *
  * By setting `concurrent`, opendal will fetch chunks concurrently with
  * the given chunk size. Without `chunk`, OpenDAL does not read concurrently.
+ * `0` has the same behavior as `1`.
  *
  * @param opts The opendal_read_options to modify.
  * @param concurrent The value to set; `0` is the default.
@@ -4750,6 +4755,7 @@ void 
opendal_reader_options_set_content_length_hint(struct opendal_reader_option
  * By setting `concurrent`, opendal will fetch chunks concurrently with
  * the given chunk size. Without `chunk`, a reader from
  * `opendal_operator_reader_with()` does not read concurrently.
+ * `0` has the same behavior as `1`.
  *
  * @param opts The opendal_reader_options to modify.
  * @param concurrent The value to set; `0` is the default.
@@ -5065,7 +5071,8 @@ void opendal_write_options_set_if_not_exists(struct 
opendal_write_options *opts,
  * ## Behavior
  *
  * - By default, OpenDAL writes files sequentially
- * - When concurrent is set:
+ * - `0` has the same behavior as `1`
+ * - When concurrent is greater than `1`:
  *   - Multiple write operations can execute in parallel
  *   - Write operations return immediately without waiting if tasks space are 
available
  *   - Close operation ensures all writes complete in order
@@ -5295,7 +5302,8 @@ void 
opendal_copy_options_set_source_content_length_hint(struct opendal_copy_opt
  * the copier from `opendal_operator_copier_with()`.
  *
  * This is a best-effort execution option. Services that cannot split copy
- * into concurrent server-side tasks can ignore it.
+ * into concurrent server-side tasks can ignore it. `0` has the same
+ * behavior as `1`.
  *
  * @param opts The opendal_copy_options to modify.
  * @param concurrent The value to set; `0` is the default.
diff --git a/bindings/c/src/options.rs b/bindings/c/src/options.rs
index 3db880c421..3ff77de384 100644
--- a/bindings/c/src/options.rs
+++ b/bindings/c/src/options.rs
@@ -1015,6 +1015,7 @@ pub struct opendal_read_options {
     ///
     /// By setting `concurrent`, opendal will fetch chunks concurrently with
     /// the given chunk size. Without `chunk`, OpenDAL does not read 
concurrently.
+    /// `0` has the same behavior as `1`.
     ///
     /// `0` is the default.
     pub concurrent: usize,
@@ -1304,6 +1305,7 @@ impl opendal_read_options {
     ///
     /// By setting `concurrent`, opendal will fetch chunks concurrently with
     /// the given chunk size. Without `chunk`, OpenDAL does not read 
concurrently.
+    /// `0` has the same behavior as `1`.
     ///
     /// @param opts The opendal_read_options to modify.
     /// @param concurrent The value to set; `0` is the default.
@@ -1709,6 +1711,7 @@ pub struct opendal_reader_options {
     /// By setting `concurrent`, opendal will fetch chunks concurrently with
     /// the given chunk size. Without `chunk`, a reader from
     /// `opendal_operator_reader_with()` does not read concurrently.
+    /// `0` has the same behavior as `1`.
     ///
     /// `0` is the default.
     pub concurrent: usize,
@@ -1942,6 +1945,7 @@ impl opendal_reader_options {
     /// By setting `concurrent`, opendal will fetch chunks concurrently with
     /// the given chunk size. Without `chunk`, a reader from
     /// `opendal_operator_reader_with()` does not read concurrently.
+    /// `0` has the same behavior as `1`.
     ///
     /// @param opts The opendal_reader_options to modify.
     /// @param concurrent The value to set; `0` is the default.
@@ -2322,7 +2326,8 @@ pub struct opendal_write_options {
     /// ## Behavior
     ///
     /// - By default, OpenDAL writes files sequentially
-    /// - When concurrent is set:
+    /// - `0` has the same behavior as `1`
+    /// - When concurrent is greater than `1`:
     ///   - Multiple write operations can execute in parallel
     ///   - Write operations return immediately without waiting if tasks space 
are available
     ///   - Close operation ensures all writes complete in order
@@ -2709,7 +2714,8 @@ impl opendal_write_options {
     /// ## Behavior
     ///
     /// - By default, OpenDAL writes files sequentially
-    /// - When concurrent is set:
+    /// - `0` has the same behavior as `1`
+    /// - When concurrent is greater than `1`:
     ///   - Multiple write operations can execute in parallel
     ///   - Write operations return immediately without waiting if tasks space 
are available
     ///   - Close operation ensures all writes complete in order
@@ -3047,7 +3053,8 @@ pub struct opendal_copy_options {
     /// the copier from `opendal_operator_copier_with()`.
     ///
     /// This is a best-effort execution option. Services that cannot split copy
-    /// into concurrent server-side tasks can ignore it.
+    /// into concurrent server-side tasks can ignore it. `0` has the same
+    /// behavior as `1`.
     ///
     /// `0` is the default.
     pub concurrent: usize,
@@ -3204,7 +3211,8 @@ impl opendal_copy_options {
     /// the copier from `opendal_operator_copier_with()`.
     ///
     /// This is a best-effort execution option. Services that cannot split copy
-    /// into concurrent server-side tasks can ignore it.
+    /// into concurrent server-side tasks can ignore it. `0` has the same
+    /// behavior as `1`.
     ///
     /// @param opts The opendal_copy_options to modify.
     /// @param concurrent The value to set; `0` is the default.
diff --git a/bindings/cpp/include/options.hpp b/bindings/cpp/include/options.hpp
index 5c33344c5f..50f479f88c 100644
--- a/bindings/cpp/include/options.hpp
+++ b/bindings/cpp/include/options.hpp
@@ -317,7 +317,8 @@ struct ReadOptions {
   /// storage services.
   ///
   /// By setting `concurrent`, opendal will fetch chunks concurrently with the
-  /// given chunk size. Without `chunk`, OpenDAL does not read concurrently.
+  /// given chunk size. Without `chunk`, OpenDAL does not read concurrently. 
`0`
+  /// has the same behavior as `1`.
   std::size_t concurrent{0};
   /// Set `chunk` for the operation.
   ///
@@ -449,7 +450,8 @@ struct ReaderOptions {
   /// storage services.
   ///
   /// By setting `concurrent`, opendal will fetch chunks concurrently with the
-  /// given chunk size. Without `chunk`, OpenDAL does not read concurrently.
+  /// given chunk size. Without `chunk`, OpenDAL does not read concurrently. 
`0`
+  /// has the same behavior as `1`.
   std::size_t concurrent{0};
   /// Set `chunk` for the operation.
   ///
@@ -670,7 +672,8 @@ struct WriteOptions {
   /// ## Behavior
   ///
   /// - By default, OpenDAL writes files sequentially
-  /// - When concurrent is set:
+  /// - `0` has the same behavior as `1`
+  /// - When concurrent is greater than `1`:
   ///   - Multiple write operations can execute in parallel
   ///   - Write operations return immediately without waiting if tasks space 
are
   ///   available
@@ -800,7 +803,8 @@ struct CopyOptions {
   /// Sets concurrent copy operations for `opendal::Operator::Copy`.
   ///
   /// This is a best-effort execution option. Services that cannot split copy
-  /// into concurrent server-side tasks can ignore it.
+  /// into concurrent server-side tasks can ignore it. `0` has the same 
behavior
+  /// as `1`.
   std::size_t concurrent{0};
   /// Sets chunk size for segmented copy operations.
   ///
diff --git a/bindings/go/options.go b/bindings/go/options.go
index 0caa203b59..e074cf37cd 100644
--- a/bindings/go/options.go
+++ b/bindings/go/options.go
@@ -783,6 +783,7 @@ func ReadWithIfUnmodifiedSince(t time.Time) WithReadFn {
 //
 // By setting `ReadWithConcurrent`, opendal will fetch chunks concurrently with
 // the given chunk size. Without `ReadWithChunk`, OpenDAL does not read 
concurrently.
+// `0` has the same behavior as `1`.
 //
 // A value of 0 leaves it unset.
 func ReadWithConcurrent(concurrent uint) WithReadFn {
@@ -1256,6 +1257,7 @@ func ReaderWithContentLengthHint(length uint64) 
WithReaderFn {
 // By setting `ReaderWithConcurrent`, opendal will fetch chunks concurrently 
with
 // the given chunk size. Without `ReaderWithChunk`, a `Reader` from
 // `Operator.Reader` does not read concurrently.
+// `0` has the same behavior as `1`.
 //
 // A value of 0 leaves it unset.
 func ReaderWithConcurrent(concurrent uint) WithReaderFn {
@@ -1691,7 +1693,8 @@ func WriteWithIfNotExists(ifNotExists bool) WithWriteFn {
 // # Behavior
 //
 //   - By default, OpenDAL writes files sequentially
-//   - When concurrent is set:
+//   - `0` has the same behavior as `1`
+//   - When concurrent is greater than `1`:
 //   - Multiple write operations can execute in parallel
 //   - Write operations return immediately without waiting if tasks space are 
available
 //   - Close operation ensures all writes complete in order
@@ -2142,7 +2145,8 @@ func CopyWithSourceContentLengthHint(length uint64) 
WithCopyFn {
 // from `Operator.Copier`.
 //
 // This is a best-effort execution option. Services that cannot split copy
-// into concurrent server-side tasks can ignore it.
+// into concurrent server-side tasks can ignore it. `0` has the same
+// behavior as `1`.
 //
 // A value of 0 leaves it unset.
 func CopyWithConcurrent(concurrent uint) WithCopyFn {
diff --git a/bindings/nodejs/generated.d.ts b/bindings/nodejs/generated.d.ts
index 267ec164eb..6bc9c2489d 100644
--- a/bindings/nodejs/generated.d.ts
+++ b/bindings/nodejs/generated.d.ts
@@ -1365,6 +1365,7 @@ export interface ReaderOptions {
    *
    * By setting `concurrent`, opendal will fetch chunks concurrently with
    * the given chunk size. Without `chunk`, `reader()` and `readerSync()` do 
not read concurrently.
+   * `0` has the same behavior as `1`.
    *
    * The value must be an integer between 0 and 4294967295.
    */
@@ -1504,6 +1505,7 @@ export interface ReadOptions {
    *
    * By setting `concurrent`, opendal will fetch chunks concurrently with
    * the given chunk size. Without `chunk`, OpenDAL does not read concurrently.
+   * `0` has the same behavior as `1`.
    *
    * The value must be an integer between 0 and 4294967295.
    */
@@ -1962,7 +1964,8 @@ export interface WriteOptions {
    * ## Behavior
    *
    * - By default, OpenDAL writes files sequentially
-   * - When concurrent is set:
+   * - `0` has the same behavior as `1`
+   * - When concurrent is greater than `1`:
    *   - Multiple write operations can execute in parallel
    *   - Write operations return immediately without waiting if tasks space 
are available
    *   - Close operation ensures all writes complete in order
diff --git a/bindings/nodejs/src/options/read.rs 
b/bindings/nodejs/src/options/read.rs
index 32d55acd1c..5f4d739349 100644
--- a/bindings/nodejs/src/options/read.rs
+++ b/bindings/nodejs/src/options/read.rs
@@ -53,6 +53,7 @@ pub struct ReadOptions {
     ///
     /// By setting `concurrent`, opendal will fetch chunks concurrently with
     /// the given chunk size. Without `chunk`, OpenDAL does not read 
concurrently.
+    /// `0` has the same behavior as `1`.
     ///
     /// The value must be an integer between 0 and 4294967295.
     pub concurrent: Option<f64>,
diff --git a/bindings/nodejs/src/options/reader.rs 
b/bindings/nodejs/src/options/reader.rs
index 196172bde7..855b5467fb 100644
--- a/bindings/nodejs/src/options/reader.rs
+++ b/bindings/nodejs/src/options/reader.rs
@@ -56,6 +56,7 @@ pub struct ReaderOptions {
     ///
     /// By setting `concurrent`, opendal will fetch chunks concurrently with
     /// the given chunk size. Without `chunk`, `reader()` and `readerSync()` 
do not read concurrently.
+    /// `0` has the same behavior as `1`.
     ///
     /// The value must be an integer between 0 and 4294967295.
     pub concurrent: Option<f64>,
diff --git a/bindings/nodejs/src/options/write.rs 
b/bindings/nodejs/src/options/write.rs
index 4225d814c9..773158179d 100644
--- a/bindings/nodejs/src/options/write.rs
+++ b/bindings/nodejs/src/options/write.rs
@@ -241,7 +241,8 @@ pub struct WriteOptions {
     /// ## Behavior
     ///
     /// - By default, OpenDAL writes files sequentially
-    /// - When concurrent is set:
+    /// - `0` has the same behavior as `1`
+    /// - When concurrent is greater than `1`:
     ///   - Multiple write operations can execute in parallel
     ///   - Write operations return immediately without waiting if tasks space 
are available
     ///   - Close operation ensures all writes complete in order
diff --git a/bindings/python/python/opendal/options.py 
b/bindings/python/python/opendal/options.py
index 4cf057c9df..482e71cfa1 100644
--- a/bindings/python/python/opendal/options.py
+++ b/bindings/python/python/opendal/options.py
@@ -88,6 +88,7 @@ class ReadKwargs(TypedDict, total=False):
 
     By setting `concurrent`, opendal will fetch chunks concurrently with
     the given chunk size. Without `chunk`, OpenDAL does not read concurrently.
+    `0` has the same behavior as `1`.
     """
     chunk: int
     """Set `chunk` for the operation.
@@ -284,7 +285,8 @@ class WriteKwargs(TypedDict, total=False):
     ## Behavior
 
     - By default, OpenDAL writes files sequentially
-    - When concurrent is set:
+    - `0` has the same behavior as `1`
+    - When concurrent is greater than `1`:
       - Multiple write operations can execute in parallel
       - Write operations return immediately without waiting if tasks space are 
available
       - Close operation ensures all writes complete in order
diff --git a/bindings/python/src/options/generated.rs 
b/bindings/python/src/options/generated.rs
index 4549d8556d..5b68fc3dd9 100644
--- a/bindings/python/src/options/generated.rs
+++ b/bindings/python/src/options/generated.rs
@@ -336,6 +336,7 @@ pub struct ReadOptions {
     ///
     /// By setting `concurrent`, opendal will fetch chunks concurrently with
     /// the given chunk size. Without `chunk`, OpenDAL does not read 
concurrently.
+    /// `0` has the same behavior as `1`.
     pub concurrent: Option<usize>,
     /// Set `chunk` for the operation.
     ///
@@ -570,7 +571,8 @@ pub struct WriteOptions {
     /// ## Behavior
     ///
     /// - By default, OpenDAL writes files sequentially
-    /// - When concurrent is set:
+    /// - `0` has the same behavior as `1`
+    /// - When concurrent is greater than `1`:
     ///   - Multiple write operations can execute in parallel
     ///   - Write operations return immediately without waiting if tasks space 
are available
     ///   - Close operation ensures all writes complete in order
diff --git a/core/core/src/types/operator/operator_futures.rs 
b/core/core/src/types/operator/operator_futures.rs
index d86cfd1ff7..616fbc4f46 100644
--- a/core/core/src/types/operator/operator_futures.rs
+++ b/core/core/src/types/operator/operator_futures.rs
@@ -338,6 +338,7 @@ impl<F: Future<Output = Result<Buffer>>> FutureRead<F> {
     ///
     /// By setting `concurrent`, opendal will fetch chunks concurrently with
     /// the given chunk size. Without `chunk`, OpenDAL does not read 
concurrently.
+    /// `0` has the same behavior as `1`.
     ///
     /// ```
     /// # use opendal_core::Result;
@@ -531,6 +532,7 @@ impl<F: Future<Output = Result<Reader>>> FutureReader<F> {
     /// By setting `concurrent`, opendal will fetch chunks concurrently with
     /// the given chunk size. Without `chunk`, only [`Reader::fetch`]
     /// reads concurrently, with one request per merged range.
+    /// `0` has the same behavior as `1`.
     ///
     /// ```
     /// # use opendal_core::Result;
diff --git a/core/core/src/types/options.rs b/core/core/src/types/options.rs
index 808b1bb6af..f540ae1755 100644
--- a/core/core/src/types/options.rs
+++ b/core/core/src/types/options.rs
@@ -333,6 +333,7 @@ pub struct ReadOptions {
     ///
     /// By setting `concurrent`, opendal will fetch chunks concurrently with
     /// the given chunk size. Without `chunk`, OpenDAL does not read 
concurrently.
+    /// `0` has the same behavior as `1`.
     ///
     /// Refer to the [performance 
guide](https://github.com/apache/opendal/tree/main/core/core/src/docs/performance)
     /// for more details.
@@ -503,6 +504,7 @@ pub struct ReaderOptions {
     /// By setting `concurrent`, opendal will fetch chunks concurrently with
     /// the given chunk size. Without `chunk`, only [`crate::Reader::fetch`]
     /// reads concurrently, with one request per merged range.
+    /// `0` has the same behavior as `1`.
     ///
     /// Refer to the [performance 
guide](https://github.com/apache/opendal/tree/main/core/core/src/docs/performance)
     /// for more details.
@@ -944,7 +946,8 @@ pub struct WriteOptions {
     /// ## Behavior
     ///
     /// - By default, OpenDAL writes files sequentially
-    /// - When concurrent is set:
+    /// - `0` has the same behavior as `1`
+    /// - When concurrent is greater than `1`:
     ///   - Multiple write operations can execute in parallel
     ///   - Write operations return immediately without waiting if tasks space 
are available
     ///   - Close operation ensures all writes complete in order
@@ -1244,7 +1247,8 @@ pub struct CopyOptions {
     /// Sets concurrent copy operations for this copier.
     ///
     /// This is a best-effort execution option. Services that cannot split copy
-    /// into concurrent server-side tasks can ignore it.
+    /// into concurrent server-side tasks can ignore it. `0` has the same
+    /// behavior as `1`.
     pub concurrent: usize,
 
     /// Sets chunk size for segmented copy operations.
diff --git a/dev/src/generate/nodejs.rs b/dev/src/generate/nodejs.rs
index 34dd672c04..84a947e9d5 100644
--- a/dev/src/generate/nodejs.rs
+++ b/dev/src/generate/nodejs.rs
@@ -1438,7 +1438,7 @@ mod tests {
             "Reader::metadata",
             "A later stat",
             "crate::Operator",
-            "`0` has",
+            "`0` has the same behavior as omitting it",
             "WriteOptions::",
             "if_not_exists",
         ] {
@@ -1448,7 +1448,7 @@ mod tests {
 
     #[test]
     fn test_write_options_docs_keep_nested_lists() {
-        // Core nests list items under `When concurrent is set:` and others;
+        // Core nests list items under the `concurrent` bullet and others;
         // napi-rs keeps the indentation in `generated.d.ts`.
         let rendered = render(core_options("WriteOptions"), 
&WRITE_OPTIONS).unwrap();
         for expected in [
@@ -1459,7 +1459,7 @@ mod tests {
                 "    /// - If not supported, will return an error\n",
             ),
             concat!(
-                "    /// - When concurrent is set:\n",
+                "    /// - When concurrent is greater than `1`:\n",
                 "    ///   - Multiple write operations can execute in 
parallel\n",
             ),
             concat!(

Reply via email to