Run a task in a fixed period loop.

### Hierarchy

- TaskLooper

## Index

### Constructors

- constructor

### Properties

- _fn
- _isLooping
- _isStarted
- _timeout

### Methods

- _runLoop
- start
- stop

## Constructors

### constructor

- new TaskLooper(fn: () => Promise<void>): TaskLooper

- - Defined in src/utils/TaskLooper.ts:16

  Build the looper with a function to invoke on a fixed period loop.

  #### Parameters

  - ##### fn: () => Promise<void>

    the async function to invoke

    - - (): Promise<void>

      - #### Returns Promise<void>

  #### Returns TaskLooper

## Properties

### _fn

_fn: () => Promise<void>

- Defined in src/utils/TaskLooper.ts:6

#### Type declaration

- - (): Promise<void>

  - #### Returns Promise<void>

### _isLooping

_isLooping: boolean

- Defined in src/utils/TaskLooper.ts:8

### _isStarted

_isStarted: boolean

- Defined in src/utils/TaskLooper.ts:7

### _timeout

_timeout: undefined | Timeout

- Defined in src/utils/TaskLooper.ts:9

## Methods

### _runLoop

- _runLoop(periodInMs: number): Promise<void>

- - Defined in src/utils/TaskLooper.ts:43

  #### Parameters

  - ##### periodInMs: number

  #### Returns Promise<void>

### start

- start(periodInMs: number): void

- - Defined in src/utils/TaskLooper.ts:27

  Start the task loop.

  #### Parameters

  - ##### periodInMs: number

    the loop period in milliseconds

  #### Returns void

### stop

- stop(): void

- - Defined in src/utils/TaskLooper.ts:36

  Stop the task loop.

  #### Returns void

Generated using TypeDoc