Skip to content

Commit 4a7f466

Browse files
committed
wip
1 parent d1399f4 commit 4a7f466

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

packages/browser/src/plugins/segmentio/shared-dispatcher.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ interface DispatchConfig {
2424
/**
2525
* This is useful for ensuring that an event is sent even if the user navigates away from the page.
2626
* However, it may increase the likelihood of events being lost, as there is a 64kb limit for *all* fetch requests (not just ones to segment) with keepalive (which is why it's disabled by default). So, if you're sending a lot of data, this will likely cause events to be dropped.
27+
2728
* @default false
2829
*/
2930
keepalive?: boolean
@@ -41,8 +42,25 @@ interface DispatchConfig {
4142
}
4243

4344
export interface BatchingDispatchConfig extends DispatchConfig {
45+
/**
46+
* The maximum number of events to send in a single request. If the batch reaches this size, a request will automatically be sent.
47+
*
48+
* @default 10
49+
*/
4450
size?: number
51+
/**
52+
* The maximum time, in milliseconds, to wait before sending a request.
53+
* This won't alaways be relevant, as the request will be sent when the size is reached.
54+
* However, if the size is never reached, the request will be sent after this time.
55+
* When it comes to retries, if there is a rate limit timeout header, that will be respected over the value here.
56+
*
57+
* @default 5000
58+
*/
4559
timeout?: number
60+
/**
61+
* The maximum number of retries to attempt before giving up.
62+
* @default 10
63+
*/
4664
maxRetries?: number
4765
}
4866

0 commit comments

Comments
 (0)