IegTools.FluentPollster 1.0.0-beta.2

This is a prerelease version of IegTools.FluentPollster.
There is a newer version of this package available.
See the version list below for details.
dotnet add package IegTools.FluentPollster --version 1.0.0-beta.2
NuGet\Install-Package IegTools.FluentPollster -Version 1.0.0-beta.2
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="IegTools.FluentPollster" Version="1.0.0-beta.2" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add IegTools.FluentPollster --version 1.0.0-beta.2
#r "nuget: IegTools.FluentPollster, 1.0.0-beta.2"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install IegTools.FluentPollster as a Cake Addin
#addin nuget:?package=IegTools.FluentPollster&version=1.0.0-beta.2&prerelease

// Install IegTools.FluentPollster as a Cake Tool
#tool nuget:?package=IegTools.FluentPollster&version=1.0.0-beta.2&prerelease

IegTools.FluentPollster

FluentPollster provides a user-friendly fluent interface for creating easy-to-read polling tasks.

Why 'yet another polling library'?

I found that FluentScheduler didn't meet my requirements.
I had some ideas and well it's less than 500 loc at the moment, so thats nothing.
Hey and it's fun.

Usage

To get into the details study the IntegrationTests.

Simple polling job

You can add any Action as job to the PollsterBuilder,
specify the poll-intervall and the condition,
build the Pollster and run it.

public void SimplePolling()
{
    var counter = 0;
    var uut = PollsterBuilder.Create()
        .AddJob(() => counter++, TimeSpan.FromMilliseconds(100), () => IsWhatSoEverCondition());

    var pollster = uut.Build();
    
    // run only once, so the time when you call it belongs to you
    pollster.Run();
}

Automatic polling jobs

You can add any Action as job to the PollsterBuilder,
specify the poll-intervall (also without any condition),
build the Pollster and run it in automatic-mode.

public void AutomaticPolling()
{
    var counter = 0;
    var uut = PollsterBuilder.Create()
        .AddJob(() => counter++, TimeSpan.FromSeconds(5));

    var pollster = uut.Build();
    
    // run automatic (like FluentScheduler does it...)
    pollster.RunAutomaticEvery(TimeSpan.FromSeconds(10));
}

Details

You can inject an ILogger
    PollsterBuilder.Create().SetLogger(logger);
Set the maximum poll tasks that should be executed during one poll cycle
	PollsterBuilder.Create().SetMaxJobsPerPoll(10);

to be continued...

Product Compatible and additional computed target framework versions.
.NET net7.0 is compatible.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
2.2.0 236 10/17/2023
2.1.1 153 5/3/2023
2.1.0 133 5/2/2023
2.0.0 171 4/17/2023
1.1.0-rc.1 83 4/15/2023
1.0.1 156 4/5/2023
1.0.0 178 4/5/2023
1.0.0-beta.3 96 4/4/2023
1.0.0-beta.2 84 4/4/2023
1.0.0-beta.1 84 4/3/2023

NuGet Package with readme.md