You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 obviously 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 *goar.Client 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 arweave, 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.
The text was updated successfully, but these errors were encountered:
Hello yes, we support ctx on post data on arweave, but not support download data from arweave.
it is so easy if support this, if you have enough time, and you can try to implement it and submit a pr. I would be very grateful.
Laisky
added a commit
to Laisky/goar
that referenced
this issue
May 20, 2024
closeseverFinance#56
Here is the commit message:
**Summary**
This commit adds support for context parameters to various functions across the codebase, enabling cancellation of long-running operations and improving error handling.
**Key Changes**
- Added context support to various functions, such as `GetTransactionData`, `BroadcastData`, `Send*`, and `WarpTransfer`, allowing for cancellation and improved error handling.
- Updated multiple files to use the `context` package and its functions.
- Modified several functions to take a `context.Context` as an argument, enabling cancellation and better error handling.
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 obviously 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 gohttp
package supports contexts with functions likehttp.NewRequestWithContext
.Even if I use contexts and goroutines to disregard the response of a *goar.Client 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 arweave, 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.
The text was updated successfully, but these errors were encountered: