Skip to content

Repository files navigation

SimpleLoops

Library for running async loops

How to use it

AsyncLoopsBackgroundService detects all IAsyncLoop service registrations (such as services.AddSingleton<IAsyncLoop, AsyncLoop()) and run them.
At minimum, the following services needs to be registered:

services.AddHostedService<AsyncLoopsBackgroundService>();     /* background service which runs the loops */
services.AddSingleton<IAsyncLoop, AsyncLoop>();               /* custom async loop, expending `AsyncLoopBase` or implementing `IAsyncLoop` */
services.AddSingleton<AsyncLoopConfiguration>();              /* only if applied to all async loops */

/* dependencies */
services.AddSingleton<ITask, TaskDelayWrapper>();
services.AddSingleton<IDateTime, DateTimeWrapper>();

Code sample

About

Simple library for running loops in parallel

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages