ServiceStack v8.4!

We’re happy to announce ServiceStack.Jobs our effortless solution for queueing and managing background jobs and scheduled tasks in any .NET 8 App, implemented in true ServiceStack fashion where it seamlessly integrates into existing ServiceStack Apps with a built-in Management UI to provide real-time monitoring, inspection and management of background jobs.

Schedule Recurring Tasks

Real Time Admin UI

Dashboard Summary of Executed, Failed and Cancelled Jobs and Worker Stats

View Real-time progress of queued Jobs

View real-time progress logs of executing Jobs

View Job Summary and Monthly Databases of Completed and Failed Jobs

View full state and execution history of each Job

Cancel Running jobs and Requeue failed jobs

Feature Overview

Despite being a v1 release it packs all the features we wanted to use in a Background Jobs solution including:

  • No infrastructure dependencies
    • Monthly archivable rolling Databases with full Job Execution History
  • Execute existing APIs or versatile Commands
    • Commands auto registered in IOC
  • Scheduled Reoccurring Tasks
    • Track Last Job Run
  • Serially execute jobs with the same named Worker
  • Queue Jobs dependent on successful completion of parent Job
  • Queue Jobs to be executed after a specified Date
  • Execute Jobs within the context of an Authenticated User
  • Auto retry failed jobs on a default or per-job limit
  • Timeout Jobs on a default or per-job limit
  • Cancellable Jobs
  • Requeue Failed Jobs
  • Execute custom callbacks on successful execution of Job
  • Maintain Status, Logs and Progress of Executing Jobs
  • Execute transitive (i.e. non-durable) jobs using named workers
  • Attach optional Tag, BatchId, CreatedBy, ReplyTo and Args with Jobs

SQLite Request Logs

The next feature added is a SQLite backed provider for Request Logs with the new SqliteRequestLogger which can be added to existing .NET 8 Apps with the mix tool:

$ x mix sqlitelogs

Rolling SQLite Databases

The benefit of using SQLite is that databases can be created on-the-fly where Requests will be persisted into isolated requests Monthly databases which can be easily archived into managed file storage instead of a singular growing database, visible in the Database Admin UI:

SQLite logs will also make it easier to generate monthly aggregate reports to provide key insights into the usage of your App.

Admin Logging UI

As SQLite Requests Logs also makes it efficiently possible to sort and filter through logs, the Logging UI will switch to using a fully queryable AutoQueryGrid when using SqliteRequestLogger:

API Keys protected managed File Uploads

HTTP Client Factory HTTP Utils

Scalable SQLite

A number of features were added to easily develop safe, concurrent and scalable Apps with SQLite.

pvq.app

An OSS alternative to StackOverflow which uses the best proprietary and OSS Large Language Models to answer your technical questions. pvq.app is populated with over 1M+ answers for the highest rated StackOverflow questions - checkout pvq.app/leaderboard to find the best performing LLM models.

AI Server

The independent Microservice used to provide all AI Features used by the above applications.

It’s already been used to execute millions of LLM and Comfy UI Requests to generate Open AI Chat Answers and Generated Images used to populate the blazordiffusion.com and pvq.app websites.

It was the project used to develop and test Background Jobs in action where it serves as a private gateway to process all LLM, AI and image transformations requests that any of our Apps need where it dynamically delegates requests across multiple Ollama, Open AI Chat, LLM Gateway, Comfy UI, Whisper and ffmpeg providers.

Checkout the ServiceStack v8.4 Release Notes for the full info.

1 Like

How does this work in relation with IIS periodically “freezing” web-apps?

In my experience at least, during quiet hours, web-apps running in IIS will “stop”. So any timed stuff will stop. If there’s a API call externally, then IIS will start the app, so from the outside it’s like it’s always running.

For this reason I had to implement long running (polling) externally as a Windows Service, calling the API from “the outside”. Then if the app was stopped by IIS, it would be started again. When I did the polling from inside the app, even though there were active timers, IIS would stop the app.

Is this an issue at all, with the Job functionality? E.g. a recurring job to run every 10 minutes forever?

Background Jobs doesn’t do anything special to cater for IIS, it simply executes new jobs in a background task and has a background periodic timer running in a C# BackgroundService for executing periodic and outstanding tasks.

It’s durable in that it will requeue and execute incomplete jobs after App restarts but your .NET App needs to be running for it to be able do that. IIS periodically killing apps isn’t a great fit for long running Apps, so you’d typically want to configure .NET Apps to autostart and set to Always Running, Hangfire’s docs for running on IIS is also relevant and covers this:

https://docs.hangfire.io/en/latest/deployment-to-production/making-aspnet-app-always-running.html