跳到主要内容
版本:Next

Framework

Hierarchy

Implements

Index

Constructors

constructor

  • new Framework(applicationContext: IMidwayContainer): BullFramework

Properties

app

readonlyapplicationContext

applicationContext: IMidwayContainer

configService

configService: MidwayConfigService

configurationOptions

configurationOptions: any

environmentService

environmentService: MidwayEnvironmentService

informationService

informationService: MidwayInformationService

loggerService

loggerService: MidwayLoggerService

middlewareService

middlewareService: MidwayMiddlewareService<Context, unknown, unknown>

mockService

mockService: MidwayMockService

Methods

publicaddProcessor

  • addProcessor(processor: new (...args: any[]) => IProcessor, queueName: string | BullQueue, concurrency?: number): Promise<void>

applicationInitialize

  • applicationInitialize(options: IMidwayBootstrapOptions): Promise<void>

applyMiddleware

  • applyMiddleware<R, N>(lastMiddleware?: CommonMiddlewareUnion<Context, R, N>): Promise<MiddlewareRespond<Context, R, N>>
  • Type parameters

    • R
    • N

configure

  • configure(): any

createLogger

  • createLogger(name: string, option?: MidwayLoggerOptions): any

publiccreateQueue

  • createQueue(name: string, queueOptions?: QueueOptions): BullQueue

publicensureQueue

  • ensureQueue(name: string, queueOptions?: QueueOptions): BullQueue

getAppDir

  • getAppDir(): string

getApplication

getApplicationContext

  • getApplicationContext(): IMidwayContainer

getBaseDir

  • getBaseDir(): string

getConfiguration

  • getConfiguration(key?: string): any

getCoreLogger

  • getCoreLogger(): ILogger

getCurrentEnvironment

  • getCurrentEnvironment(): string

getFrameworkName

  • getFrameworkName(): string

publicgetJob

  • getJob(queueName: string, jobName: string): Promise<Job<any>>

getLogger

  • getLogger(name?: string): any

getMiddleware

  • getMiddleware(): ContextMiddlewareManager<Context, unknown, unknown>

getNamespace

  • getNamespace(): string

getProjectName

  • getProjectName(): string

publicgetQueue

publicgetQueueList

init

initialize

  • initialize(options?: IMidwayBootstrapOptions): Promise<void>

isEnable

  • isEnable(): boolean

publicloadConfig

  • loadConfig(): void

run

  • run(): Promise<void>

runGuard

  • runGuard(ctx: Context, supplierClz: new (...args: any[]) => any, methodName: string): Promise<boolean>

publicrunJob

  • runJob(queueName: string, jobData: any, options?: JobOptions): Promise<Job<any>>

setNamespace

  • setNamespace(namespace: string): void

stop

  • stop(): Promise<void>

useFilter

  • useFilter(filter: CommonFilterUnion<Context, unknown, unknown>): void

useGuard

  • useGuard(guards: CommonGuardUnion<Context>): void

useMiddleware

  • useMiddleware(middleware: CommonMiddlewareUnion<Context, unknown, unknown>): void