Skip to content

Timeout #17

Open
Open

Description

@jfanals

Is there a way of passing a timeout option (open_timeout, read_timeout, write_timeout) to the http methods?

Activity

  1. ozkrpp commented on Sep 9, 2022

    @ozkrpp

    This wasn't easy so I will share it in case anyone else is struggling with it. You can pass the timeout_options like this if you want a timeout per operation (there is a global timeout as well but I haven't used it):

    get('test', headers: request_headers, timeout_class: HTTP::Timeout::PerOperation, timeout_options: {read_timeout: TIMEOUT_VALUE, write_timeout: TIMEOUT_VALUE})

    You can also configure connect_timeout

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions