TickerQTickerQ
Guides

Configuration

Scheduler options, serialization, seeding, and persistence.

All options are configured inside the AddTickerQ lambda. See Quick Start for the minimal setup.

Start modes

ModeBehaviour
ImmediateStarts processing as soon as the host is ready (default)
ManualSkips first run — call ITickerQHostScheduler.StartAsync() to begin
app.UseTickerQ(TickerQStartMode.Manual);

Scheduler options

opt.ConfigureScheduler(s =>
{
    s.MaxConcurrency        = 16;
    s.NodeIdentifier        = Environment.MachineName;
    s.SchedulerTimeZone     = TimeZoneInfo.FindSystemTimeZoneById("America/New_York");
    s.MinPollingInterval    = TimeSpan.FromSeconds(1);
    s.FallbackIntervalChecker = TimeSpan.FromSeconds(30);
    s.IdleWorkerTimeOut     = TimeSpan.FromMinutes(1);
});
OptionDefaultDescription
MaxConcurrencyProcessorCountMax parallel jobs (excludes LongRunning)
NodeIdentifierMachineNameInstance ID for multi-node
SchedulerTimeZoneLocalTimezone for cron evaluation
MinPollingInterval1sMin pause between DB polls
FallbackIntervalChecker30sFallback check for stuck jobs
IdleWorkerTimeOut1minIdle worker thread lifetime

Queue-only mode

For apps that only schedule jobs but don't process them:

opt.DisableBackgroundServices();

Only ITimeTickerManager and ICronTickerManager are available.


Serialization

Custom JSON options

opt.ConfigureRequestJsonOptions(json =>
{
    json.PropertyNamingPolicy = JsonNamingPolicy.CamelCase;
});

AOT / trimming

[JsonSerializable(typeof(OrderPayload))]
public partial class AppJsonContext : JsonSerializerContext { }

// Registration
opt.WithJsonContext(AppJsonContext.Default);

GZip compression

opt.UseGZipCompression();

Payloads are created with TickerHelper.CreateTickerRequest<T>() and read back transparently.


Seeding

Automatic cron seeding

Functions with cronExpression in [TickerFunction] are auto-seeded on startup. Disable with:

opt.IgnoreSeedDefinedCronTickers();

Custom seeding

opt.UseTickerSeeder(
    async timeManager =>
    {
        await timeManager.AddAsync(new TimeTickerEntity
        {
            Function      = "initial-setup",
            ExecutionTime = DateTime.UtcNow.AddSeconds(10),
        });
    },
    async cronManager =>
    {
        await cronManager.AddAsync(new CronTickerEntity
        {
            Function   = "weekly-cleanup",
            Expression = "0 3 * * 0",
            IsEnabled  = true,
        });
    }
);

Seeding order: dead-node cleanup → auto cron seeding → custom time seeder → custom cron seeder → scheduler starts.


Persistence

Jobs are in-memory by default. Add a provider for production:

// EF Core
opt.AddOperationalStore(ef =>
    ef.UseTickerQDbContext<TickerQDbContext>(o => o.UseSqlServer(connectionString)));

// Redis
opt.AddStackExchangeRedis(r => r.Configuration = "localhost:6379");

See Entity Framework Core and Redis.

On this page