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

monitor status across multiple reads? #1

Open
porjo opened this issue Sep 9, 2016 · 1 comment
Open

monitor status across multiple reads? #1

porjo opened this issue Sep 9, 2016 · 1 comment

Comments

@porjo
Copy link

porjo commented Sep 9, 2016

For example a HTTP transfer done in chunks, using flowrate inside a http.RoundTripper:

func (t *limitTransport) RoundTrip(r *http.Request) (res *http.Response, err error) {
  body := flowrate.NewReader(r.Body, -1)
  r.Body = body
  // track  body.Monitor.Status() here
  return
}

(full source code can be seen here)

I'd like to keep track of the overall status of the transfer, however I find that Monitor gets flagged as not active at the end of the first roundtrip and so cannot be reused.

@porjo
Copy link
Author

porjo commented Nov 4, 2016

I've worked around this by commenting out defer.Done() in Reader.Close()

@porjo porjo closed this as completed Nov 4, 2016
@porjo porjo reopened this Aug 19, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant