Options
All
  • Public
  • Public/Protected
  • All
Menu

Class NestMicroservice

Hierarchy

  • NestApplicationContext
    • NestMicroservice

Implements

  • INestApplicationContext
  • INestMicroservice

Index

Constructors

constructor

Properties

Private Readonly applicationConfig

applicationConfig: ApplicationConfig

Protected Readonly container

container: NestContainer

Protected Readonly injector

injector: Injector

Private isInitHookCalled

isInitHookCalled: boolean = false

Protected isInitialized

isInitialized: boolean

Private isTerminated

isTerminated: boolean = false

Private Readonly logger

logger: Logger = new Logger(NestMicroservice.name, true)

Private microserviceConfig

microserviceConfig: MicroserviceOptions

Private Readonly microservicesModule

microservicesModule: MicroservicesModule = new MicroservicesModule()

Private server

Private Readonly socketModule

socketModule: any = SocketModule ? new SocketModule() : null

Methods

Protected callBeforeShutdownHook

  • callBeforeShutdownHook(signal?: string): Promise<void>
  • Calls the beforeApplicationShutdown function on the registered modules and children.

    Parameters

    • Optional signal: string

    Returns Promise<void>

Protected callBootstrapHook

  • callBootstrapHook(): Promise<void>
  • Calls the onApplicationBootstrap function on the registered modules and its children.

    Returns Promise<void>

Protected callDestroyHook

  • callDestroyHook(): Promise<void>
  • Calls the onModuleDestroy function on the registered modules and its children.

    Returns Promise<void>

Protected callInitHook

  • callInitHook(): Promise<void>
  • Calls the onModuleInit function on the registered modules and its children.

    Returns Promise<void>

Protected callShutdownHook

  • callShutdownHook(signal?: string): Promise<void>
  • Calls the onApplicationShutdown function on the registered modules and children.

    Parameters

    • Optional signal: string

    Returns Promise<void>

close

  • close(): Promise<any>

Protected closeApplication

  • closeApplication(): Promise<any>

createServer

Protected dispose

  • dispose(): Promise<void>

enableShutdownHooks

  • Enables the usage of shutdown hooks. Will call the onApplicationShutdown function of a provider if the process receives a shutdown signal.

    Parameters

    Returns this

    The Nest application context instance

Protected find

  • find<TInput, TResult>(typeOrToken: Type<TInput> | Abstract<TInput> | string | symbol, contextModule?: Module): TResult
  • Type parameters

    • TInput = any

    • TResult = TInput

    Parameters

    • typeOrToken: Type<TInput> | Abstract<TInput> | string | symbol
    • Optional contextModule: Module

    Returns TResult

get

  • get<TInput, TResult>(typeOrToken: Type<TInput> | Abstract<TInput> | string | symbol, options?: { strict: boolean }): TResult
  • Type parameters

    • TInput = any

    • TResult = TInput

    Parameters

    • typeOrToken: Type<TInput> | Abstract<TInput> | string | symbol
    • Optional options: { strict: boolean }
      • strict: boolean

    Returns TResult

init

  • init(): Promise<this>

listen

  • listen(callback: () => void): void

listenAsync

  • listenAsync(): Promise<any>

Protected listenToShutdownSignals

  • listenToShutdownSignals(signals: string[]): void
  • Listens to shutdown signals by listening to process events

    Parameters

    • signals: string[]

      The system signals it should listen to

    Returns void

registerListeners

  • registerListeners(): void

registerModules

  • registerModules(): Promise<any>

registerRequestByContextId

  • registerRequestByContextId<T>(request: T, contextId: ContextId): void
  • Type parameters

    • T = any

    Parameters

    • request: T
    • contextId: ContextId

    Returns void

resolve

  • resolve<TInput, TResult>(typeOrToken: Type<TInput> | Abstract<TInput> | string | symbol, contextId?: ContextId, options?: { strict: boolean }): Promise<TResult>
  • Type parameters

    • TInput = any

    • TResult = TInput

    Parameters

    • typeOrToken: Type<TInput> | Abstract<TInput> | string | symbol
    • Optional contextId: ContextId
    • Optional options: { strict: boolean }
      • strict: boolean

    Returns Promise<TResult>

Protected resolvePerContext

  • resolvePerContext<TInput, TResult>(typeOrToken: Type<TInput> | Abstract<TInput> | string | symbol, contextModule: Module, contextId: ContextId, options?: { strict: boolean }): Promise<TResult>
  • Type parameters

    • TInput = any

    • TResult = TInput

    Parameters

    • typeOrToken: Type<TInput> | Abstract<TInput> | string | symbol
    • contextModule: Module
    • contextId: ContextId
    • Optional options: { strict: boolean }
      • strict: boolean

    Returns Promise<TResult>

select

  • select<T>(moduleType: Type<T>): INestApplicationContext
  • Type parameters

    • T

    Parameters

    • moduleType: Type<T>

    Returns INestApplicationContext

selectContextModule

  • selectContextModule(): void

setIsInitHookCalled

  • setIsInitHookCalled(isInitHookCalled: boolean): void

setIsInitialized

  • setIsInitialized(isInitialized: boolean): void

setIsTerminated

  • setIsTerminated(isTerminated: boolean): void

Protected unsubscribeFromProcessSignals

  • unsubscribeFromProcessSignals(): void

useGlobalFilters

  • useGlobalFilters(...filters: ExceptionFilter[]): this

useGlobalGuards

  • useGlobalGuards(...guards: CanActivate[]): this

useGlobalInterceptors

  • useGlobalInterceptors(...interceptors: NestInterceptor[]): this

useGlobalPipes

  • useGlobalPipes(...pipes: PipeTransform<any>[]): this

useLogger

  • useLogger(logger: LoggerService | LogLevel[] | false): void
  • Parameters

    • logger: LoggerService | LogLevel[] | false

    Returns void

useWebSocketAdapter

  • useWebSocketAdapter(adapter: WebSocketAdapter): this

Generated using TypeDoc