@@ -15,7 +15,7 @@ Organize related tasks to create complex workflows:
1515// src/app/tasks/data-processing.ts
1616import { task } from ' @commandkit/tasks' ;
1717
18- export const dataProcessing = task ({
18+ export default task ({
1919 name: ' data-processing' ,
2020 schedule: ' 0 2 * * *' , // Daily at 2 AM
2121 async execute(ctx ) {
@@ -43,7 +43,7 @@ Implement custom retry logic for failed tasks:
4343// src/app/tasks/retry-example.ts
4444import { task } from ' @commandkit/tasks' ;
4545
46- export const retryTask = task ({
46+ export default task ({
4747 name: ' retry-task' ,
4848 async execute(ctx ) {
4949 const { attempt = 1 , maxAttempts = 3 } = ctx .data ;
@@ -87,7 +87,7 @@ Manage tasks that depend on other conditions:
8787// src/app/tasks/dependency-example.ts
8888import { task } from ' @commandkit/tasks' ;
8989
90- export const dependencyTask = task ({
90+ export default task ({
9191 name: ' dependency-task' ,
9292 async execute(ctx ) {
9393 const { requiredData } = ctx .data ;
@@ -114,7 +114,7 @@ Process multiple items in batches:
114114// src/app/tasks/batch-processing.ts
115115import { task } from ' @commandkit/tasks' ;
116116
117- export const batchProcessor = task ({
117+ export default task ({
118118 name: ' batch-processor' ,
119119 schedule: ' 0 */6 * * *' , // Every 6 hours
120120 async execute(ctx ) {
@@ -156,7 +156,7 @@ Track task execution metrics:
156156// src/app/tasks/metrics.ts
157157import { task } from ' @commandkit/tasks' ;
158158
159- export const metricsTask = task ({
159+ export default task ({
160160 name: ' metrics-task' ,
161161 schedule: ' 0 * * * *' , // Every hour
162162 async execute(ctx ) {
@@ -197,7 +197,7 @@ Use the context store to manage state across task executions:
197197// src/app/tasks/state-management.ts
198198import { task } from ' @commandkit/tasks' ;
199199
200- export const statefulTask = task ({
200+ export default task ({
201201 name: ' stateful-task' ,
202202 schedule: ' 0 */2 * * *' , // Every 2 hours
203203 async prepare(ctx ) {
@@ -235,7 +235,7 @@ Implement cleanup tasks for resource management:
235235// src/app/tasks/cleanup.ts
236236import { task } from ' @commandkit/tasks' ;
237237
238- export const cleanupTask = task ({
238+ export default task ({
239239 name: ' cleanup' ,
240240 schedule: ' 0 3 * * *' , // Daily at 3 AM
241241 async execute(ctx ) {
@@ -263,7 +263,7 @@ Implement robust error recovery mechanisms:
263263// src/app/tasks/error-recovery.ts
264264import { task } from ' @commandkit/tasks' ;
265265
266- export const resilientTask = task ({
266+ export default task ({
267267 name: ' resilient-task' ,
268268 async execute(ctx ) {
269269 const { operation, fallbackOperation } = ctx .data ;
@@ -303,7 +303,7 @@ export const resilientTask = task({
303303// src/app/tasks/rolling-window.ts
304304import { task } from ' @commandkit/tasks' ;
305305
306- export const rollingWindowTask = task ({
306+ export default task ({
307307 name: ' rolling-window' ,
308308 schedule: ' */15 * * * *' , // Every 15 minutes
309309 async execute(ctx ) {
@@ -325,7 +325,7 @@ export const rollingWindowTask = task({
325325// src/app/tasks/adaptive-processing.ts
326326import { task } from ' @commandkit/tasks' ;
327327
328- export const adaptiveTask = task ({
328+ export default task ({
329329 name: ' adaptive-task' ,
330330 schedule: ' */5 * * * *' , // Every 5 minutes
331331 async execute(ctx ) {
0 commit comments