Skip to content
This repository has been archived by the owner on Feb 7, 2024. It is now read-only.

Support context.Context #293

Closed
benny-conn opened this issue May 10, 2023 · 2 comments
Closed

Support context.Context #293

benny-conn opened this issue May 10, 2023 · 2 comments
Labels
need/triage Needs initial labeling and prioritization

Comments

@benny-conn
Copy link

I wish I could use this library but because it does not support go's context.Context, I can't reliably use it. This library performs operations over a network and it is common practice to use a context so that network operations can be cancelled by the context, either by manual cancellation or deadline. The go http package supports contexts with functions like http.NewRequestWithContext.

Even if I use contexts and goroutines to disregard the response of a shell request when a context times out for example, there is no way to stop the execution of a function. If I were to be downloading content from ipfs, it would continue downloading despite the context cancelling, and the program continuing running.

The only workaround I can see is manually setting a timeout on the http client, but this is bad practice and not predictable.

@benny-conn benny-conn added the need/triage Needs initial labeling and prioritization label May 10, 2023
@welcome

This comment was marked as resolved.

@lidel
Copy link
Member

lidel commented May 15, 2023

@benny-conn we are in the process of unifying our RPC client story (ipfs/kubo#9124), so it is unlikely we will break/change API here until that issue is resolved (closing this, let's continue there).

For now, maybe you could see if https://github.com/ipfs/go-ipfs-http-client is enough for your use case?

@lidel lidel closed this as not planned Won't fix, can't repro, duplicate, stale May 15, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
need/triage Needs initial labeling and prioritization
Projects
None yet
Development

No branches or pull requests

2 participants