@@ -4,10 +4,10 @@ title: ServiceStack v8.4
4
4
5
5
![ ] ( /img/pages/release-notes/v8.4/bg-sqlite.webp )
6
6
7
- We're happy to announce ** ServiceStack. Jobs** our effortless solution for queueing and managing
7
+ We're excited to announce ** Background Jobs** our effortless solution for queueing and managing
8
8
background jobs and scheduled tasks in any .NET 8 App, implemented in true ServiceStack fashion
9
- where it seamlessly integrates into existing ServiceStack Apps with a [ built-in ] ( /auto-ui ) Management UI
10
- to provide real-time monitoring, inspection and management of background jobs.
9
+ where it seamlessly integrates into existing Apps and call existing APIs and sports a
10
+ [ built-in ] ( https://servicestack.net/auto-ui ) Management UI to provide real-time monitoring, inspection and management of background jobs.
11
11
12
12
<p class =" hide-h2 " ></p >
13
13
@@ -25,10 +25,9 @@ to provide real-time monitoring, inspection and management of background jobs.
25
25
</div >
26
26
</div >
27
27
28
-
29
28
### Durable and Infrastructure-Free
30
29
31
- Prior to Jobs we've been using [ Background MQ] ( /background-mq ) for executing
30
+ Prior to Background Jobs we've been using [ Background MQ] ( /background-mq ) for executing
32
31
our background tasks which lets you queue any Request DTO to execute its API in a background worker.
33
32
It's been our preferred choice as it didn't require any infrastructure dependencies since its concurrent
34
33
queues are maintained in memory, this also meant they were non-durable that didn't survive across App restarts.
@@ -38,19 +37,19 @@ designed for the task.
38
37
39
38
#### SQLite Persistence
40
39
41
- We decided on using SQLite as the backing store for durable jobs since it's low latency,
40
+ It uses SQLite as the backing store for its durability since it's low latency,
42
41
[ fast disk persistence] ( https://www.sqlite.org/fasterthanfs.html ) and embeddable file-based
43
- database makes it ideally suited for the task which allows creation of naturally partitionable
44
- and archivable monthly databases on-the-fly without any additional admin overhead or external
45
- infrastructure dependencies making it an easy add-on into any .NET App without impacting or
46
- adding load to its existing configured databases.
42
+ database makes it ideally suited for the task which allows creation of naturally partition-able
43
+ and archivable monthly databases on-the-fly without any maintenance overhead or infrastructure
44
+ dependencies making it easy to add to any .NET App without impacting or adding increased load to
45
+ their existing configured databases.
47
46
48
47
### Queue APIs or Commands
49
48
50
- To enable even better reuse of ServiceStack APIs you're able to queue your existing ServiceStack APIs
51
- as a background job in addition to [ Commands] ( /commands ) added in the
52
- [ last v8.3 release] ( /releases/v8_03 ) used for encapsulating units of logic
53
- that can be used as internal invokable, inspectable and auto-retryable building blocks.
49
+ For even greater reuse you're able to queue your existing ServiceStack APIs
50
+ as a Background Job in addition to [ Commands] ( /commands ) added in the
51
+ [ last v8.3 release] ( /releases/v8_03 ) for encapsulating units of logic
52
+ into internal invokable, inspectable and auto-retryable building blocks.
54
53
55
54
### Real Time Admin UI
56
55
@@ -80,7 +79,7 @@ Cancel Running jobs and Requeue failed jobs
80
79
81
80
### Feature Overview
82
81
83
- Despite being a v1 release it packs all the features we wanted to use in a Background Jobs solution including :
82
+ Even in its v1 release it packs all the features we wanted in a Background Jobs solution:
84
83
85
84
- No infrastructure dependencies
86
85
- Monthly archivable rolling Databases with full Job Execution History
@@ -101,8 +100,7 @@ Despite being a v1 release it packs all the features we wanted to use in a Backg
101
100
- Execute transitive (i.e. non-durable) jobs using named workers
102
101
- Attach optional ` Tag ` , ` BatchId ` , ` CreatedBy ` , ` ReplyTo ` and ` Args ` with Jobs
103
102
104
- Please [ let us know] ( https://servicestack.net/ideas ) if there are any other missing features
105
- you would love to see implemented.
103
+ Please [ let us know] ( https://servicestack.net/ideas ) of any other missing features you'd love to see implemented.
106
104
107
105
## Install
108
106
@@ -123,8 +121,8 @@ Existing .NET 8 Projects can configure their app to use **ServiceStack.Jobs** by
123
121
x mix jobs
124
122
:::
125
123
126
- Which adds the ` Configure.BackgroundJobs.cs ` [ Modular Startup] ( /modular-startup )
127
- configuration and ** ServiceStack.Jobs** Reference to your project.
124
+ Which adds the ` Configure.BackgroundJobs.cs ` [ Modular Startup] ( https://docs.servicestack.net /modular-startup)
125
+ configuration and a ** ServiceStack.Jobs** NuGet package reference to your project.
128
126
129
127
## Usage
130
128
@@ -200,11 +198,14 @@ the following options:
200
198
201
199
### Schedule Recurring Tasks
202
200
201
+ In addition to queueing jobs to run in the background, it also supports scheduling recurring tasks
202
+ to execute APIs or Commands at fixed intervals.
203
+
203
204
:::youtube DtB8KaXXMCM
204
205
Schedule your Reoccurring Tasks with Background Jobs!
205
206
:::
206
207
207
- APIs and Commands can be scheduled to run at either a ` TimeSpan ` or
208
+ APIs and Commands can be scheduled to run at either a ` TimeSpan ` or
208
209
[ CRON Expression] ( https://github.com/HangfireIO/Cronos?tab=readme-ov-file#cron-format ) interval, e.g:
209
210
210
211
``` csharp
@@ -221,7 +222,7 @@ jobs.RecurringApi(Schedule.Interval(TimeSpan.FromMinutes(1)), new CheckUrls {
221
222
});
222
223
```
223
224
224
- Scheduled Tasks can be registered with an optional task name and custom Background Options, e.g:
225
+ That can be registered with an optional ** Task Name ** and ** Background Options** , e.g:
225
226
226
227
``` csharp
227
228
jobs .RecurringCommand <CheckUrlsCommand >(" Check URLs" , Schedule .EveryMinute ,
@@ -230,14 +231,18 @@ jobs.RecurringCommand<CheckUrlsCommand>("Check URLs", Schedule.EveryMinute,
230
231
});
231
232
```
232
233
233
- If no task name is provided, the Command Name or APIs Request DTO will be used.
234
+ ::: info
235
+ If no name is provided, the Command's Name or APIs Request DTO will be used
236
+ :::
234
237
235
- Scheduled Tasks are idempotent where the same registration with the same name will
238
+ Scheduled Tasks are idempotent where the same registration with the same name will
236
239
either create or update the scheduled task registration without losing track of the
237
240
last time the Recurring Task was run which is also viewable in the Jobs Admin UI:
238
241
239
242
![ ] ( /img/pages/jobs/jobs-scheduled-tasks-last-job.webp )
240
243
244
+ As such it's recommended to always define your App's Scheduled Tasks on Startup:
245
+
241
246
### Executing non-durable jobs
242
247
243
248
` IBackgroundJobs ` also supports ` RunCommand ` methods to be able to execute jobs transiently
@@ -928,10 +933,10 @@ of a singular growing database, visible in the [Database Admin UI](/admin-ui-dat
928
933
SQLite logs will also make it easier to generate monthly aggregate reports to provide key insights
929
934
into the usage of your App.
930
935
931
- ## Admin Logging UI
936
+ ## AutoQuery Grid Admin Logging UI
932
937
933
938
As SQLite Requests Logs also makes it efficiently possible to sort and filter through logs, the
934
- Logging UI will switch to using a fully queryable AutoQueryGrid when using ` SqliteRequestLogger ` :
939
+ Logging UI will switch to using a fully queryable ` AutoQueryGrid ` when using ` SqliteRequestLogger ` :
935
940
936
941
![ ] ( /img/pages/sqlite/sqlite-request-logs.webp )
937
942
0 commit comments