Class Throttler
Makes sure a method is always called 'MillisecondsToDelay' after the previous call.
Inherited Members
Namespace: Mapsui.Fetcher
Assembly: Mapsui.dll
Syntax
public class Throttler
Methods
| Edit this page View SourceExecuteAsync(Action, int)
Schedules the specified action to be executed after a minimum delay,
ensuring that at least delayBetweenCalls milliseconds have elapsed since the previous execution.
If multiple calls are made in quick succession, only the most recent is executed.
Declaration
public Task ExecuteAsync(Action action, int delayBetweenCalls)
Parameters
| Type | Name | Description |
|---|---|---|
| Action | action | The action to execute. |
| int | delayBetweenCalls | The minimum number of milliseconds between two executions. |
Returns
| Type | Description |
|---|---|
| Task |
ExecuteAsync(Func<Task>, int)
Schedules the specified asynchronous function to be executed after a minimum delay,
ensuring that at least delayBetweenCalls milliseconds have elapsed since the previous execution.
If multiple calls are made in quick succession, only the most recent is executed.
Declaration
public Task ExecuteAsync(Func<Task> func, int delayBetweenCalls)
Parameters
| Type | Name | Description |
|---|---|---|
| Func<Task> | func | The asynchronous function to execute. |
| int | delayBetweenCalls | The minimum number of milliseconds between two executions. |
Returns
| Type | Description |
|---|---|
| Task |