edgekitjs - v0.0.51
    Preparing search index...

    Interface Options

    interface Options {
        orm?: { logger?: Logger; schema: DatabaseSchema };
        rateLimit?: WorkerKVRateLimit.Options;
        jobs(): Job<Data<Parser<unknown>>>[];
        onJobError(error: unknown, message: Message): void;
        onQueue(
            batch: MessageBatch,
            env: Environment,
            ctx: ExecutionContext,
        ): Promise<void>;
        onRequest(
            request: Request,
            env: Environment,
            ctx: ExecutionContext,
        ): Promise<Response>;
        onSchedule(
            event: ScheduledController,
            env: Environment,
            ctx: ExecutionContext,
        ): Promise<void>;
        onTaskError(error: unknown, task: Task): void;
        tasks(): Task[];
    }
    Index

    Properties

    orm?: { logger?: Logger; schema: DatabaseSchema }

    The options for the ORM.

    Type declaration

    • Optionallogger?: Logger

      The logger for the ORM.

    • schema: DatabaseSchema

      The database schema for the ORM.

    The options for the rate limit.

    Methods

    • A function that returns the list of jobs to register

      Returns Job<Data<Parser<unknown>>>[]

    • A function that will run if a job failed

      Parameters

      • error: unknown
      • message: Message

      Returns void

    • The function that will run every time a queue message is consumed

      Parameters

      • batch: MessageBatch
      • env: Environment
      • ctx: ExecutionContext

      Returns Promise<void>

    • The function that will run every time a new request comes in

      Parameters

      Returns Promise<Response>

    • The function that will run every time a scheduled task is executed

      Parameters

      • event: ScheduledController
      • env: Environment
      • ctx: ExecutionContext

      Returns Promise<void>

    • A function that will run if a task failed

      Parameters

      • error: unknown
      • task: Task

      Returns void