Mzu.Libs.Rollercoaster 1.0.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package Mzu.Libs.Rollercoaster --version 1.0.0
NuGet\Install-Package Mzu.Libs.Rollercoaster -Version 1.0.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="Mzu.Libs.Rollercoaster" Version="1.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Mzu.Libs.Rollercoaster --version 1.0.0
#r "nuget: Mzu.Libs.Rollercoaster, 1.0.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 Mzu.Libs.Rollercoaster as a Cake Addin
#addin nuget:?package=Mzu.Libs.Rollercoaster&version=1.0.0

// Install Mzu.Libs.Rollercoaster as a Cake Tool
#tool nuget:?package=Mzu.Libs.Rollercoaster&version=1.0.0

RollerCoaster Project

The RollerCoaster Project is a lightweight library that allows you to schedule and run methods at specific intervals using background services. It provides an easy way to execute methods periodically without blocking the main thread.

Features

  • Schedule methods to run at specified intervals
  • Support for static and non-static methods
  • Support for dependency injection within scheduled methods
  • Thread-safe execution of methods within the same group
  • Ability to name and manage background services

Getting Started

To use the RollerCoaster Project in your own project, follow these steps:

  1. Install the RollerCoaster NuGet package:

dotnet add package RollerCoaster

  1. Add the RollerCoaster attribute to the methods you want to schedule for periodic execution:
[RollerCoaster(interval: 2000)]
public void MyMethod()
{
    // Method implementation
}
  1. In your application startup code, call the RollerCoasterMethodExecutor.ExecuteRollerCoasterMethods method:
var serviceProvider = // Your service provider instance
RollerCoasterMethodExecutor.ExecuteRollerCoasterMethods(serviceProvider);
  1. Run your application and observe the scheduled methods executing at the specified intervals.

###RollerCoasterAttribute The RollerCoasterAttribute is used to mark methods for scheduled execution. It provides the following options:

interval: Specifies the interval in milliseconds at which the method should be executed. group (optional): Specifies the group to which the background service belongs. name (optional): Specifies a name for the background service.

##RollerCoasterExample The RollerCoasterExample class is an example class that demonstrates the usage of the RollerCoaster Project. It contains methods marked with the RollerCoasterAttribute for scheduling execution.

public class RollerCoasterExample
{
    private readonly IExampleRepository _exampleRepository;

    public RollerCoasterExample(IExampleRepository exampleRepository)
    {
        _exampleRepository = exampleRepository;
    }

    [RollerCoaster(2000, name: "SetDataMethod")]
    public void SetDataMethod()
    {
        // Method implementation
    }

    [RollerCoaster(3000, name: "GetDataMethod")]
    public void GetDataMethod()
    {
        // Method implementation
    }
}

##Contributing Contributions to the RollerCoaster Project are welcome! If you find a bug, have an enhancement request, or want to contribute code, please open an issue or submit a pull request.

##License The RollerCoaster Project is licensed under the MIT License. See the LICENSE file for more information.

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
1.1.0 147 5/29/2023
1.0.0 129 5/23/2023

It is the initial release