Stone.js API
    Preparing search index...
    OnJob: (name: string) => MethodDecorator = ...

    Method decorator: mark a method as the handler for a job name.

    Use it on the methods of a class also decorated with @JobHandler() (which registers the class as a service and marks it for scanning). One class can handle several jobs, one method each. The method receives (payload, job) like any handler.

    Type Declaration

      • (name: string): MethodDecorator
      • Parameters

        • name: string

          The job name this method handles.

        Returns MethodDecorator

        A method decorator.

    @JobHandler()
    export class Jobs {
    @OnJob('send-email') sendEmail (payload) { ... }
    @OnJob('resize') resize (payload) { ... }
    }