Skip to main content

Class: TemporalModule

Defined in: src/temporal.module.ts:47

Main Temporal module for NestJS applications.

This module provides:

  • Temporal client connection management with connection pooling
  • Worker creation and lifecycle management
  • Activity and workflow discovery
  • Schedule management
  • Comprehensive logging and error handling
  • Graceful degradation and fault tolerance
  • Automatic shutdown hook registration for graceful termination (call app.enableShutdownHooks())

IMPORTANT: To ensure graceful worker shutdown, you must call app.enableShutdownHooks() in your main.ts file after creating the NestJS application:

Example​

async function bootstrap() {
const app = await NestFactory.create(AppModule);
app.enableShutdownHooks(); // Required for graceful worker shutdown
await app.listen(3000);
}

Constructors​

Constructor​

new TemporalModule(): TemporalModule

Returns​

TemporalModule

Methods​

register()​

static register(options?): DynamicModule

Defined in: src/temporal.module.ts:48

Parameters​

options?​

Partial<TemporalOptions> = {}

Returns​

DynamicModule


registerAsync()​

static registerAsync(options): DynamicModule

Defined in: src/temporal.module.ts:67

Parameters​

options​

TemporalAsyncOptions

Returns​

DynamicModule