You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/connections/functions/insert-functions.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -239,7 +239,7 @@ To prevent your insert function from processing data, toggle Enable Function off
239
239
Batch handlers are an extension of insert functions. When you define an `onBatch` handler alongside the handler functions for single events (for example, `onTrack` or `onIdentity`), you're telling Segment that the insert function can accept and handle batches of events.
240
240
241
241
> info ""
242
-
> Batching is available for insert and destination functions only.
242
+
> Batching is available for destination and destination insert functions only.
243
243
244
244
### When to use batching
245
245
@@ -265,7 +265,7 @@ async function onBatch(events, settings){
265
265
```
266
266
267
267
> info ""
268
-
> The `onBatch` handler is an optional extension. Destination insert functions must still contain single event handlers as a fallback, in cases where Segment does not receive enough events to execute the batch.
268
+
> The `onBatch` handler is an optional extension. Destination insert functions must still contain single event handlers as a fallback, in cases where Segment doesn't receive enough events to execute the batch.
269
269
270
270
The handler function receives an array of events. The events can be of any supported type and a single batch may contain more than one event type. Handler functions can also receive function settings. Here is an example of what a batch can look like:
271
271
@@ -340,7 +340,7 @@ async function onIdentifyBatch(events, settings) {
340
340
341
341
### Configure your batch parameters
342
342
343
-
By default, Functions waits up to 10 seconds to form a batch of 20 events. You can increase the number of events included in each batch (up to 400 events per batch) by contacting [Segment support](https://segment.com/help/contact/){:target="_blank"}. Segment recommends users who wish to include fewer than 20 events per batch use destination functions without the `onBatch` handler.
343
+
By default, Functions waits up to 10 seconds to form a batch of 20 events. You can increase the number of events included in each batch (up to 400 events per batch) by contacting [Segment support](https://segment.com/help/contact/){:target="_blank"}. Segment recommends users who wish to include fewer than 20 events per batch use destination insert functions without the `onBatch` handler.
344
344
345
345
### Test the batch handler
346
346
@@ -351,7 +351,7 @@ To test the batch handler:
351
351
2. Add events as a JSON array, with one event per element.
352
352
3. Click **Run** to preview the batch handler with the specified events.
353
353
354
-
> note ""
354
+
> info ""
355
355
> The Sample Event option tests single events only. You must use Manual Mode to add more than one event so you can test batch handlers.
356
356
357
357
The editor displays logs and request traces from the batch handler.
@@ -389,7 +389,7 @@ Standard [function error types](/docs/connections/functions/destination-function
389
389
]
390
390
```
391
391
392
-
After receiving the response from the `onBatch` handler, Segment only retries **event_4** and **event_5**.
392
+
For example, after receiving the responses above from the `onBatch` handler, Segment only retries **event_4** and **event_5**.
0 commit comments