Follow-up from "Download Code"
The following discussions from !220 (merged) should be addressed:
-
@ChrisSchinnerl started a discussion: (+1 comment) I would wrap the buffer in a custom bufferpool type. Then when you call
Get
it will already return a*bytes.Buffer
without the caller casting it and it will also reset the buffer.So when you fetch a buffer from the pool in multiple places you can never forget to reset it.
Maybe call it
staticExecuteProgramBufferPool
too. We might want different buffer pools later and make sure that we don't reuse buffers for different tasks to guarantee that they are approximately the same size. -
@ChrisSchinnerl started a discussion: (+2 comments) Why
1<<12
? Did you empirically measure the size of the buffers? -
@ChrisSchinnerl started a discussion: (+2 comments) I think
currentDownload
being a method on thepdc
doesn't make sense. Because the current download or current piece is a concept that lives in the worker.So it should be a method on the worker instead and probably be called
currentPiece
. -
@ChrisSchinnerl started a discussion: (+2 comments) I think
callUpdateAvailabilityMetrics
is also missing testing. -
@MSevey started a discussion: Follow up: remove print