Stream: git-wasmtime

Topic: wasmtime / PR #8330 Remove the worker field from HostInco...


view this post on Zulip Wasmtime GitHub notifications bot (Apr 11 2024 at 14:41):

rylev requested fitzgen for a review on PR #8330.

view this post on Zulip Wasmtime GitHub notifications bot (Apr 11 2024 at 14:41):

rylev requested wasmtime-core-reviewers for a review on PR #8330.

view this post on Zulip Wasmtime GitHub notifications bot (Apr 11 2024 at 14:41):

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 an Option allowing those who don't need to keep a worker alive to simply set the field to None. 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.

view this post on Zulip Wasmtime GitHub notifications bot (Apr 11 2024 at 15:17):

alexcrichton submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Apr 11 2024 at 16:01):

alexcrichton merged PR #8330.


Last updated: Nov 22 2024 at 17:03 UTC