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

Support cancellation of NGINX Plus API calls #205

Open
pleshakov opened this issue Jan 18, 2024 · 2 comments
Open

Support cancellation of NGINX Plus API calls #205

pleshakov opened this issue Jan 18, 2024 · 2 comments
Labels
backlog Pull requests/issues that are backlog items refined Issues that are ready to be prioritized

Comments

@pleshakov
Copy link
Contributor

pleshakov commented Jan 18, 2024

Is your feature request related to a problem? Please describe.

As a developer, I'd like to be able to cancel any call I make to NGINX Plus API.

This is required for my software for:

  • graceful termination. When that happens, I'd like to be able to quickly terminate any in-progress API calls.
  • configuring a API call timeout. I'd like to control how long I can allow a call to NGINX Plus API to last.

Describe the solution you'd like

Using Context https://pkg.go.dev/context#Context is common for that.

func (client *NginxClient) AddHTTPServer(upstream string, server UpstreamServer) error {

func (client *NginxClient) AddHTTPServer(ctx context.Context, upstream string, server UpstreamServer) error {

Describe alternatives you've considered

There is hard-corded timeout that internally creates a context that ensures that a request to NGINX Plus API can't take longer than 10s.

ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)

However, I'd like to control cancelation via a context (which can be cancelled before timeout expires). Additionally, I want to control the value of the timeout.

Additional context

This comment was marked as outdated.

@github-actions github-actions bot added the stale Pull requests/issues with no activity label Mar 19, 2024

This comment was marked as outdated.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Mar 26, 2024
@lucacome lucacome removed the stale Pull requests/issues with no activity label Jun 20, 2024
@lucacome lucacome reopened this Jun 20, 2024
@mpstefan mpstefan added the help wanted Issues identified as good community contribution opportunities label Jul 3, 2024
@mpstefan mpstefan added refined Issues that are ready to be prioritized and removed help wanted Issues identified as good community contribution opportunities labels Jul 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backlog Pull requests/issues that are backlog items refined Issues that are ready to be prioritized
Projects
None yet
Development

No branches or pull requests

3 participants