rylev requested fitzgen for a review on PR #8330.
rylev requested wasmtime-core-reviewers for a review on PR #8330.
rylev opened PR #8330 from rylev:rework-HostIncomingResponse
to bytecodealliance:main
:
The worker is a handle to a tokio task where the connection is being read from. It should be kept alive in order to continue to be able to read the response body. However, the worker _is_ kept alive on
HostIncomingBody
. Arguably this the exact place where the task should be kept as once that type is dropped there's no longer a need to keep the worker around.The original motivation for this change is in a project where an actual HTTP request is not being made and the response are simply mocks. In this case, there's no need to start a worker task as there is no actual connection to keep alive. An alternative to this change would be to make the
worker
field anOption
allowing those who don't need to keep a worker alive to simply set the field toNone
. However, a closer inspection of the code made it seem that this field is actually not necessary as the worker is being kept alive elsewhere.
alexcrichton submitted PR review.
alexcrichton merged PR #8330.
Last updated: Dec 23 2024 at 12:05 UTC