WorkerOptions

WorkerOptions

WorkerOptions

Options related to the Vendure Worker.

Example

import { Transport } from '@nestjs/microservices';

const config: VendureConfig = {
    // ...
    workerOptions: {
        transport: Transport.TCP,
        options: {
            host: 'localhost',
            port: 3001,
        },
    },
}

Signature

interface WorkerOptions {
  runInMainProcess?: boolean;
  transport?: Transport;
  options?: ClientOptions['options'];
}

Members

runInMainProcess

property
type:
boolean
default:
false
If set to true, the Worker will run be bootstrapped as part of the main Vendure server (when invoking the bootstrap() function) and will run in the same process. This mode is intended only for development and testing purposes, not for production, since running the Worker in the main process negates the benefits of having long-running or expensive tasks run in the background.

transport

property
type:
Transport
default:
Transport.TCP
Sets the transport protocol used to communicate with the Worker. Options include TCP, Redis, gPRC and more. See the NestJS microservices documentation for a full list.

options

property
type:
ClientOptions['options']

Additional options related to the chosen transport method. See See the NestJS microservices documentation for details on the options relating to each of the transport methods.

By default, the options for the TCP transport will run with the following settings: * host: ‘localhost’ * port: 3020