Skip to content

[python] add support for in-function concurrency#12850

Merged
QuiiBz merged 3 commits intomainfrom
python/handler-started-message
Jan 13, 2025
Merged

[python] add support for in-function concurrency#12850
QuiiBz merged 3 commits intomainfrom
python/handler-started-message

Conversation

@QuiiBz
Copy link
Copy Markdown
Member

@QuiiBz QuiiBz commented Jan 13, 2025

Add support for in-function concurrency for Python functions, since they are now streaming-capable.

Anytime a request is received, we immediately send a handler-started IPC message to our runtime, which contains the current timestamp in milliseconds. This is implemented inside the BaseHandler class, which is used by all three handlers (BaseHTTPRequestHandler, ASGI, WSGI).

Tested manually since we can't really have automated tests specifically for Python; we do have platform-level tests for in-function concurrency.

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Jan 13, 2025

🦋 Changeset detected

Latest commit: 413fd54

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

This PR includes changesets to release 2 packages
Name Type
@vercel/python Minor
vercel Patch

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

@QuiiBz QuiiBz enabled auto-merge January 13, 2025 14:18
@QuiiBz QuiiBz added this pull request to the merge queue Jan 13, 2025
Merged via the queue into main with commit 5fea2c4 Jan 13, 2025
@QuiiBz QuiiBz deleted the python/handler-started-message branch January 13, 2025 14:31
EndangeredMassa pushed a commit that referenced this pull request Jan 13, 2025
This PR was opened by the [Changesets
release](https://github.com/changesets/action) GitHub action. When
you're ready to do a release, you can merge this and the packages will
be published to npm automatically. If you're not ready to do a release
yet, that's fine, whenever you add more changesets to main, this PR will
be updated.


# Releases
## [email protected]

### Minor Changes

- [cli] add compile cache to improve startup performance
([#12783](#12783))

### Patch Changes

- [cli] standardizes uses of confirm on confirm.ts
([#12834](#12834))

- [cli] sort imports in build/index.ts
([#12833](#12833))

- Updated dependencies
\[[`5fea2c49103adf6f7153f04378bff6f571375b0e`](5fea2c4)]:
    -   @vercel/[email protected]

## @vercel/[email protected]

### Minor Changes

- Add support for in-function concurrency
([#12850](#12850))

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
QuietCraftsmanship pushed a commit to QuietCraftsmanship/Vercel that referenced this pull request Jul 6, 2025
This PR was opened by the [Changesets
release](https://github.com/changesets/action) GitHub action. When
you're ready to do a release, you can merge this and the packages will
be published to npm automatically. If you're not ready to do a release
yet, that's fine, whenever you add more changesets to main, this PR will
be updated.


# Releases
## [email protected]

### Minor Changes

- [cli] add compile cache to improve startup performance
([#12783](vercel/vercel#12783))

### Patch Changes

- [cli] standardizes uses of confirm on confirm.ts
([#12834](vercel/vercel#12834))

- [cli] sort imports in build/index.ts
([#12833](vercel/vercel#12833))

- Updated dependencies
\[[`ac7961adcbbcf65b9cc6231b581e1f04a78bba2a`](vercel/vercel@ac7961a)]:
    -   @vercel/[email protected]

## @vercel/[email protected]

### Minor Changes

- Add support for in-function concurrency
([#12850](vercel/vercel#12850))

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
github-merge-queue bot pushed a commit that referenced this pull request Jul 22, 2025
Add support for the `/_vercel/ping` endpoint to replace the
`handler-started` IPC message introduced in
#12850.

We first need to land this change (no-op), then allow our runtime to use
this new endpoint instead of the `handler-started` message, then clean
up the previous logic. We cannot test this change in CI yet (until we
land the runtime change), but I've tested it manually.
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.

2 participants