Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

client: Accept context parameter in Dial #346

Merged

Commits on Oct 5, 2022

  1. [nspcc-dev#343] client: Accept context parameter in Dial

    In previous implementation of `Client.Dial` there was no ability to
    specify parent context (e.g. global application context).
    
    Add `PrmDial.SetContext` method which accepts optional base dial
    context. Use the context to open client connection or fall back to using
    `context.Background()`.
    
    Upgraded version of `github.com/nspcc-dev/neofs-api-go/v2` module
    also fixes the problem when dial timeout didn't work properly.
    
    Signed-off-by: Leonard Lyubich <ctulhurider@gmail.com>
    cthulhu-rider committed Oct 5, 2022
    Configuration menu
    Copy the full SHA
    2289d61 View commit details
    Browse the repository at this point in the history
  2. [nspcc-dev#343] pool: Provide dial context to clients

    After recent changes `client.Client` accepts dial context. There is a
    need to forward the context passed into `Pool.Dial` to the underlying
    `Client` instances.
    
    Define type aliases of different client constructors: context-based and
    non-context. Use context-based constructor in `Pool`. Pass `ctx`
    parameter of `Pool.Dial` method to the client builder.
    
    Signed-off-by: Leonard Lyubich <ctulhurider@gmail.com>
    cthulhu-rider committed Oct 5, 2022
    Configuration menu
    Copy the full SHA
    c3398dc View commit details
    Browse the repository at this point in the history