Skip to content

Commit

Permalink
Update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
noahwillcrow committed Mar 27, 2022
1 parent 678772d commit 496abd8
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 20 deletions.
2 changes: 1 addition & 1 deletion docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@

#### Defined in

[types/BatchPostRateLimitingConfiguration.ts:9](https://github.com/Bytebit-Org/roblox-BatchCollector/blob/f54d625/src/types/BatchPostRateLimitingConfiguration.ts#L9)
[types/BatchPostRateLimitingConfiguration.ts:9](https://github.com/Bytebit-Org/roblox-BatchCollector/blob/678772d/src/types/BatchPostRateLimitingConfiguration.ts#L9)
59 changes: 49 additions & 10 deletions docs/classes/BatchCollector.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ batches will be posted as they come up in the queue on each RunService.Heartbeat

## Table of contents

### Constructors

- [constructor](BatchCollector.md#constructor)

### Methods

- [destroy](BatchCollector.md#destroy)
Expand All @@ -30,6 +34,38 @@ batches will be posted as they come up in the queue on each RunService.Heartbeat
- [pushItems](BatchCollector.md#pushitems)
- [create](BatchCollector.md#create)

## Constructors

### constructor

`Protected` **new BatchCollector**<`T`\>(`binFactory`, `dateTimeConstructor`, `doublyLinkedListFactory`, `onBatchReady`, `rateLimitingConfiguration`, `runService`, `timerFactory`, `queueFactory`)

#### Type parameters

| Name |
| :------ |
| `T` |

#### Parameters

| Name | Type | Default value |
| :------ | :------ | :------ |
| `binFactory` | `BinFactory` | `undefined` |
| `dateTimeConstructor` | `DateTimeConstructor` | `undefined` |
| `doublyLinkedListFactory` | `DoublyLinkedListFactory` | `undefined` |
| `onBatchReady` | (`batch`: `DoublyLinkedList`<`T`\>) => `void` | `undefined` |
| `rateLimitingConfiguration` | `Object` | `undefined` |
| `rateLimitingConfiguration.maxNumberOfItems` | `number` | `t.number` |
| `rateLimitingConfiguration.maxTimeBetweenPostsInSeconds` | `number` | `t.number` |
| `rateLimitingConfiguration.minTimeBetweenPostsInSeconds` | `undefined` \| `number` | `undefined` |
| `runService` | `RunService` | `undefined` |
| `timerFactory` | `TimerFactory` | `undefined` |
| `queueFactory` | `QueueFactory` | `undefined` |

#### Defined in

[classes/BatchCollector.ts:29](https://github.com/Bytebit-Org/roblox-BatchCollector/blob/678772d/src/classes/BatchCollector.ts#L29)

## Methods

### destroy
Expand All @@ -51,15 +87,16 @@ Any further calls to methods on the instance will throw errors.

#### Defined in

[classes/BatchCollector.ts:67](https://github.com/Bytebit-Org/roblox-BatchCollector/blob/f54d625/src/classes/BatchCollector.ts#L67)
[classes/BatchCollector.ts:67](https://github.com/Bytebit-Org/roblox-BatchCollector/blob/678772d/src/classes/BatchCollector.ts#L67)

___

### forcePostCurrentBatch

**forcePostCurrentBatch**(): `void`

Forces the current batch to be posted right away, ahead of any others presently in the queue
Forces the current batch to be posted right away, ahead of any others presently in the queue,
ignoring any minimum time between batch postings

#### Returns

Expand All @@ -71,15 +108,16 @@ Forces the current batch to be posted right away, ahead of any others presently

#### Defined in

[classes/BatchCollector.ts:77](https://github.com/Bytebit-Org/roblox-BatchCollector/blob/f54d625/src/classes/BatchCollector.ts#L77)
[classes/BatchCollector.ts:77](https://github.com/Bytebit-Org/roblox-BatchCollector/blob/678772d/src/classes/BatchCollector.ts#L77)

___

### forcePostRemainingBatches

**forcePostRemainingBatches**(): `void`

Forces all remaining batches, including the current one, to be posted right away in queue order
Forces all remaining batches, including the current one, to be posted right away in queue order,
ignoring any minimum time between batch postings

#### Returns

Expand All @@ -91,7 +129,7 @@ Forces all remaining batches, including the current one, to be posted right away

#### Defined in

[classes/BatchCollector.ts:95](https://github.com/Bytebit-Org/roblox-BatchCollector/blob/f54d625/src/classes/BatchCollector.ts#L95)
[classes/BatchCollector.ts:95](https://github.com/Bytebit-Org/roblox-BatchCollector/blob/678772d/src/classes/BatchCollector.ts#L95)

___

Expand All @@ -113,7 +151,7 @@ True if the current batch is empty, false otherwise

#### Defined in

[classes/BatchCollector.ts:106](https://github.com/Bytebit-Org/roblox-BatchCollector/blob/f54d625/src/classes/BatchCollector.ts#L106)
[classes/BatchCollector.ts:108](https://github.com/Bytebit-Org/roblox-BatchCollector/blob/678772d/src/classes/BatchCollector.ts#L108)

___

Expand All @@ -135,15 +173,16 @@ True if there are no batches in the queue, false otherwise

#### Defined in

[classes/BatchCollector.ts:112](https://github.com/Bytebit-Org/roblox-BatchCollector/blob/f54d625/src/classes/BatchCollector.ts#L112)
[classes/BatchCollector.ts:114](https://github.com/Bytebit-Org/roblox-BatchCollector/blob/678772d/src/classes/BatchCollector.ts#L114)

___

### pushItems

**pushItems**(`batchItems`): `void`

Pushes the given items onto the current batch.
Pushes the given items onto the current batch. The last item in the input array will be the
last item to be put into a batch.
If, during this process, the current batch fills up, it will be queued for posting.
Any remaining items will overflow into the new batch.
This queueing and creating of a new overflow batch can happen infinitely many times in one call of this method.
Expand All @@ -164,7 +203,7 @@ This queueing and creating of a new overflow batch can happen infinitely many ti

#### Defined in

[classes/BatchCollector.ts:118](https://github.com/Bytebit-Org/roblox-BatchCollector/blob/f54d625/src/classes/BatchCollector.ts#L118)
[classes/BatchCollector.ts:120](https://github.com/Bytebit-Org/roblox-BatchCollector/blob/678772d/src/classes/BatchCollector.ts#L120)

___

Expand Down Expand Up @@ -195,4 +234,4 @@ ___

#### Defined in

[classes/BatchCollector.ts:50](https://github.com/Bytebit-Org/roblox-BatchCollector/blob/f54d625/src/classes/BatchCollector.ts#L50)
[classes/BatchCollector.ts:50](https://github.com/Bytebit-Org/roblox-BatchCollector/blob/678772d/src/classes/BatchCollector.ts#L50)
21 changes: 12 additions & 9 deletions docs/interfaces/IBatchCollector.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,39 +44,41 @@ Any further calls to methods on the instance will throw errors.

#### Defined in

[interfaces/IBatchCollector.d.ts:13](https://github.com/Bytebit-Org/roblox-BatchCollector/blob/f54d625/src/interfaces/IBatchCollector.d.ts#L13)
[interfaces/IBatchCollector.d.ts:13](https://github.com/Bytebit-Org/roblox-BatchCollector/blob/678772d/src/interfaces/IBatchCollector.d.ts#L13)

___

### forcePostCurrentBatch

**forcePostCurrentBatch**(): `void`

Forces the current batch to be posted right away, ahead of any others presently in the queue
Forces the current batch to be posted right away, ahead of any others presently in the queue,
ignoring any minimum time between batch postings

#### Returns

`void`

#### Defined in

[interfaces/IBatchCollector.d.ts:18](https://github.com/Bytebit-Org/roblox-BatchCollector/blob/f54d625/src/interfaces/IBatchCollector.d.ts#L18)
[interfaces/IBatchCollector.d.ts:19](https://github.com/Bytebit-Org/roblox-BatchCollector/blob/678772d/src/interfaces/IBatchCollector.d.ts#L19)

___

### forcePostRemainingBatches

**forcePostRemainingBatches**(): `void`

Forces all remaining batches, including the current one, to be posted right away in queue order
Forces all remaining batches, including the current one, to be posted right away in queue order,
ignoring any minimum time between batch postings

#### Returns

`void`

#### Defined in

[interfaces/IBatchCollector.d.ts:23](https://github.com/Bytebit-Org/roblox-BatchCollector/blob/f54d625/src/interfaces/IBatchCollector.d.ts#L23)
[interfaces/IBatchCollector.d.ts:25](https://github.com/Bytebit-Org/roblox-BatchCollector/blob/678772d/src/interfaces/IBatchCollector.d.ts#L25)

___

Expand All @@ -94,7 +96,7 @@ True if the current batch is empty, false otherwise

#### Defined in

[interfaces/IBatchCollector.d.ts:29](https://github.com/Bytebit-Org/roblox-BatchCollector/blob/f54d625/src/interfaces/IBatchCollector.d.ts#L29)
[interfaces/IBatchCollector.d.ts:31](https://github.com/Bytebit-Org/roblox-BatchCollector/blob/678772d/src/interfaces/IBatchCollector.d.ts#L31)

___

Expand All @@ -112,15 +114,16 @@ True if there are no batches in the queue, false otherwise

#### Defined in

[interfaces/IBatchCollector.d.ts:35](https://github.com/Bytebit-Org/roblox-BatchCollector/blob/f54d625/src/interfaces/IBatchCollector.d.ts#L35)
[interfaces/IBatchCollector.d.ts:37](https://github.com/Bytebit-Org/roblox-BatchCollector/blob/678772d/src/interfaces/IBatchCollector.d.ts#L37)

___

### pushItems

**pushItems**(`items`): `void`

Pushes the given items onto the current batch.
Pushes the given items onto the current batch. The last item in the input array will be the
last item to be put into a batch.
If, during this process, the current batch fills up, it will be queued for posting.
Any remaining items will overflow into the new batch.
This queueing and creating of a new overflow batch can happen infinitely many times in one call of this method.
Expand All @@ -137,4 +140,4 @@ This queueing and creating of a new overflow batch can happen infinitely many ti

#### Defined in

[interfaces/IBatchCollector.d.ts:44](https://github.com/Bytebit-Org/roblox-BatchCollector/blob/f54d625/src/interfaces/IBatchCollector.d.ts#L44)
[interfaces/IBatchCollector.d.ts:47](https://github.com/Bytebit-Org/roblox-BatchCollector/blob/678772d/src/interfaces/IBatchCollector.d.ts#L47)

0 comments on commit 496abd8

Please sign in to comment.