Apache OpenDAL™ - v0.49.2
    Preparing search index...

    Class TimeoutLayer

    Timeout layer

    Add timeout for every operation to avoid slow or unexpected hang operations.

    Notes

    TimeoutLayer treats all operations in two kinds:

    • Non IO Operation like stat, delete they operate on a single file. We control them by setting timeout.
    • IO Operation like read, Reader::read and Writer::write, they operate on data directly, we control them by setting io_timeout.

    Default

    • timeout: 60 seconds
    • io_timeout: 10 seconds

    Examples

    const op = new Operator("fs", { root: "/tmp" })

    const timeout = new TimeoutLayer();
    timeout.timeout = 10000; // 10 seconds for non-IO ops (in milliseconds)
    timeout.ioTimeout = 3000; // 3 seconds for IO ops (in milliseconds)

    op.layer(timeout.build());
    Index

    Constructors

    Accessors

    Methods

    Constructors

    Accessors

    • set ioTimeout(v: number): void

      Set timeout for IO operations (read, write, etc.)

      Notes

      • The unit is millisecond.
      • Default is 10000ms (10 seconds).

      Parameters

      • v: number

      Returns void

    • set timeout(v: number): void

      Set timeout for non-IO operations (stat, delete, etc.)

      Notes

      • The unit is millisecond.
      • Default is 60000ms (60 seconds).

      Parameters

      • v: number

      Returns void

    Methods