Skip to content

Conversation

@tmcw
Copy link
Member

@tmcw tmcw commented Oct 8, 2025

renovate bot and others added 26 commits September 8, 2025 09:53
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
* fix: Close requests pools on termination

* Add changeset
* Don't include tests in dist

* Ignore better

* Fix biome formatting

* Add changeset

---------

Co-authored-by: maxmcd <[email protected]>
Co-authored-by: Tom MacWright <[email protected]>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
* Don't close the pool

This caused failures in prod for us: there are still messages
being sent at this point.

* Add changeset
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
* Remove configurable spawn function

* Expand on changeset

* Biome fix

* Remove type export
@changeset-bot
Copy link

changeset-bot bot commented Oct 8, 2025

🦋 Changeset detected

Latest commit: df31c24

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@valtown/deno-http-worker Major

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@tmcw tmcw requested a review from 404Wolf October 8, 2025 21:15
Copy link
Contributor

@404Wolf 404Wolf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This makes sense given how we are doing things currently!

I will caution that this gives us less control because we can't "await" the emits. I.e. if we emit, and then close the pool, and the things we emit rely on the pool being open.

});

await jsonRequest(worker, "http://localhost");
await worker.terminate();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this desired behavior? Maybe we should throw so we understand why we are terminating already terminated workers. But this is how it was previously (I think), so maybe it's fine.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Terminate has code that looks like it's trying to make it safe to call repeatedly:

async _terminate(code?: number, signal?: string) {
if (this.#terminated) {
return;
}

So I just want to, for any function that we want to treat as safe to call like that (idempotent, more or less) to confirm that they really are.

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

Successfully merging this pull request may close these issues.

Extend EventEmitter if we want event-style interfaces

4 participants