MaeveFramework 1.1.0

dotnet add package MaeveFramework --version 1.1.0
NuGet\Install-Package MaeveFramework -Version 1.1.0
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="MaeveFramework" Version="1.1.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add MaeveFramework --version 1.1.0
#r "nuget: MaeveFramework, 1.1.0"
#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 MaeveFramework as a Cake Addin
#addin nuget:?package=MaeveFramework&version=1.1.0

// Install MaeveFramework as a Cake Tool
#tool nuget:?package=MaeveFramework&version=1.1.0

MaeveFramework

Just another usefull .NET library... 😃 ❤️

Nuget

+ Jobs - Simple task scheduling

Create a Job

    public class TestJob : JobBase<string>
    {
        public TestJob(MaeveFramework.Scheduler.Abstractions.Schedule schedule, string options) : base(schedule, options)
        {
			
        }

        public override void Job()
        {
            Logger.Debug("Runned by schedule");
        }

        public override void OnStart()
        {
            Logger.Debug("On job start, once");
        }

        public override void OnStop()
        {
            Logger.Debug("On Job stop, once");
        }
    }

Add job to scheduler

// Create job from class TestJob with schedule, run every 5 minutes betwean 10 and 8 at Monday whean day of month is 1, 2 or 3.

MaeveFramework.Scheduler.SchedulerManager.CreateJob(new TestJob(new Schedule(start: TimeSpan.FromHours(10), end: TimeSpan.FromHours(20), daysOfWeek: new DayOfWeek[] { DayOfWeek.Monday }, daysOfMonth: new int[] { 1, 2, 3 }, repeat: TimeSpan.FromMinutes(5)), "test option"));

And start

MaeveFramework.Scheduler.SchedulerManager.StartAllJobs();

You can access the Job by calling it's type or GUID

TestJob job = MaeveFramework.Scheduler.SchedulerManager.Job<TestJob>();
// Or
job = TestJob job = MaeveFramework.Scheduler.SchedulerManager.Job<TestJob>(job.Guid);
var status = job.Status;
DateTime? lastRun = job.LastRun;
// Or use methods defined in job
job.SendData();

Can't wait for next job run from schedule? Force it!

SchedulerManager.JobController<TestJob>().Wake();

This wake up call will execute the job ignoring the schedule. Be aware that new NextRun time will be calculated after that.

+ Helpers

- AbstrationsHelpers

public void Knock()
{
	string whoss_there = MaeveFramework.Helpers.AbstrationsHelpers.NameOfCallingClass();
}

- ArgsArrayConverter

/// string[] { "-test arg" }
public static Main(string[] args)
{
	// { { "test", "arg" } }
	Dictionary<string, string> dictArgs = MaeveFramework.Helpers.ArgsArrayConverter.ArgsToDictionary(args, "-");
}

- IntToTimespan

using MaeveFramework.Helpers;

public TimeSpan Get10SecondsTS() 
{
	return 10.Seconds();
}

- PropertiesResolver

string text = "Current date and time: {{now}}";
string result = MaeveFramework.Helpers.Resolve(text, new { now = DateTime.Now }, false, Consts.Helpers.TAG_OPEN, Consts.Helpers.TAG_CLOSE, Consts.Helpers.ARRAY_SEPARATOR);

- Retry

MaeveFramework.Helpers.Retry.Do(() =>
{
	Console.WriteLine("I just trying to do somting here. If i throw exception i will try again 2 time with 10 seconds pause!");
    Console.WriteLine("And if i keep throwing exceptions, it will finaly throw agregated exception.");
}, TimeSpan.FromSeconds(10), 2);

=======

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  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. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 is compatible. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • .NETStandard 2.0

    • No dependencies.
  • .NETStandard 2.1

    • No dependencies.

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
1.1.0 471 11/17/2021
1.0.6.1 294 8/27/2021
1.0.5 429 1/2/2021
1.0.4.6 357 12/8/2020
1.0.4.5 403 11/21/2020
1.0.4.4 469 11/17/2020

Changed Job method for gettting Job class form manager