FaasJS
Home
  • Guide
  • Documents
  • Templates
  • Changelog
  • Ecosystem

    • Docker Images
  • Github
  • Contributing
  • Sponsor
  • Security
Home
  • Guide
  • Documents
  • Templates
  • Changelog
  • Ecosystem

    • Docker Images
  • Github
  • Contributing
  • Sponsor
  • Security

Documents / @faasjs/jobs / DefineJobOptions

Type Alias: DefineJobOptions<TSchema, TContext, TResult>

DefineJobOptions<TSchema, TContext, TResult> = object

Options for defineJob.

Type Parameters

TSchema

TSchema extends ZodType | undefined = undefined

TContext

TContext = any

TResult

TResult = any

Properties

cron?

optional cron?: JobCron<DefineJobParams<TSchema>>[]

Cron rules that trigger scheduled invocations of this job.

handler

handler: (data) => TResult | Promise<TResult>

The job handler function.

Parameters

data

DefineJobData<TSchema, TContext, TResult>

Returns

TResult | Promise<TResult>

maxAttempts?

optional maxAttempts?: number

Maximum execution attempts. Defaults to 3.

queue?

optional queue?: string

Queue name. Defaults to 'default'.

retry?

optional retry?: JobRetry

Retry strategy for failed attempts.

schema?

optional schema?: TSchema

Optional Zod schema used to validate and type handler params.