feat: Batch tasks documentation - #4586
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
mrkaye97
left a comment
There was a problem hiding this comment.
left a couple small comments!
| import { Snippet } from "@/components/code"; | ||
| import UniversalTabs from "../../components/UniversalTabs"; | ||
|
|
||
| # Batch Tasks |
There was a problem hiding this comment.
small nit - we say Batch here and Batched in the side bar
| the batched execution is hidden. It is called, and receives outputs, in the same | ||
| manner as a normal task. |
There was a problem hiding this comment.
I understand what you mean by this, but the wording is a little confusing - could use a simple example to explain (not necessarily code, just one more sentence)
| - The maximum interval has elapsed since the last batch flush. | ||
| - The size of the payloads for the buffered tasks has exceeded the 4Mb gRPC message limit. | ||
|
|
||
| In the following example, the batch task will be executed once 10 tasks have accumulated, or every 200ms, whichever comes first. |
There was a problem hiding this comment.
looks like these examples use 3 as the max size, not 10 (btw, better tooling for this would be amazing, it's hard to keep text and code in sync)
| /> | ||
| </Tabs.Tab> | ||
| </UniversalTabs> | ||
|
|
There was a problem hiding this comment.
this section on keys could use another sentence or two to explain why you might want to do that - also might reword a bit to reinforce the idea that this is basically a partition key
There was a problem hiding this comment.
makes sense--fixed
| ## Broadcasting outputs | ||
|
|
||
| In the default case, batch outputs are mapped 1-1 back to the callers. So if you called a batch task with input `a` and `b` at separate | ||
| call sites, you would receive back outputs `a'` and `b'` respectively, despite the fact they would both be executed at the same time, in the same handler. |
There was a problem hiding this comment.
very Haskelly, using a' and b' 😄
There was a problem hiding this comment.
😄 I was inspired by vector transformations, but yes
Description
Fixes # (issue)
Type of change
What's Changed
Checklist
Changes have been:
🤖 AI Disclosure