Skip to content

Commit

Permalink
Update default batch time to 25ms
Browse files Browse the repository at this point in the history
  • Loading branch information
Dominik Piatek committed Sep 8, 2023
1 parent 17fd7be commit 52973ab
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion docs/class-definitions.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ type CursorsOptions = {

##### outboundBatchInterval

The interval in milliseconds at which a batch of cursor positions are published. This is multiplied by the number of members in the space minus 1. The default value is 100ms.
The interval in milliseconds at which a batch of cursor positions are published. This is multiplied by the number of members in the space minus 1. The default value is 25ms.

##### paginationLimit

Expand Down
4 changes: 2 additions & 2 deletions src/Cursors.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ describe('Cursors', () => {
vi.spyOn(channel.presence, 'get').mockImplementation(createPresenceCount(2));
await cursors['onPresenceUpdate']();
expect(batching.shouldSend).toBeTruthy();
expect(batching.batchTime).toEqual(100);
expect(batching.batchTime).toEqual(25);
});

it<CursorsTestContext>('batchTime is updated when multiple people are present', async ({
Expand All @@ -126,7 +126,7 @@ describe('Cursors', () => {
}) => {
vi.spyOn(channel.presence, 'get').mockImplementation(createPresenceCount(2));
await cursors['onPresenceUpdate']();
expect(batching.batchTime).toEqual(100);
expect(batching.batchTime).toEqual(25);
});

describe('pushCursorPosition', () => {
Expand Down
2 changes: 1 addition & 1 deletion src/Space.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const SPACE_CHANNEL_TAG = '-space';
const SPACE_OPTIONS_DEFAULTS = {
offlineTimeout: 120_000,
cursors: {
outboundBatchInterval: 100,
outboundBatchInterval: 25,
paginationLimit: 5,
},
};
Expand Down

0 comments on commit 52973ab

Please sign in to comment.