Skip to content

monitor status across multiple reads? #1

@porjo

Description

@porjo

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions