Getting Started
Quick Start
Get TickerQ running in under 5 minutes.
1. Install
dotnet add package TickerQ2. Register services
using TickerQ.DependencyInjection;
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddTickerQ();
var app = builder.Build();
app.UseTickerQ();
app.Run();3. Define and schedule a job
using TickerQ.Utilities.Base;
public class WelcomeJobs
{
[TickerFunction("send-welcome")]
public async Task SendWelcome(
TickerFunctionContext context,
CancellationToken cancellationToken)
{
Console.WriteLine($"Job {context.Id} executed");
}
}Schedule it by function name:
var result = await timeTicker.AddAsync(new TimeTickerEntity
{
Function = "send-welcome",
ExecutionTime = DateTime.UtcNow.AddSeconds(30),
});using TickerQ.Utilities.Base;
using TickerQ.Utilities.Interfaces;
public class WelcomeJob : ITickerFunction
{
public async Task ExecuteAsync(
TickerFunctionContext context,
CancellationToken cancellationToken)
{
Console.WriteLine($"Job {context.Id} executed");
}
}builder.Services.MapTicker<WelcomeJob>();Schedule it by type — no magic strings:
var result = await timeTicker.AddAsync<WelcomeJob>(
executionTime: DateTime.UtcNow.AddSeconds(30));4. Run
dotnet runThe job fires 30 seconds later.