Options
All
  • Public
  • Public/Protected
  • All
Menu

A RequestProcessor that delegates to Node.JS Cluster workers to do the actual command and event processing.

see

ClusterWorkerRequestProcessor

Hierarchy

Implements

Index

Constructors

constructor

Properties

Protected automations

automations: AutomationServer

Private backoffInitiated

backoffInitiated: boolean = false

Private Readonly commands

commands: Map<string, { dispatched: Dispatched<HandlerResult>; worker: number }> = new Map()

Protected configuration

configuration: Configuration

Private Readonly events

events: Map<string, { dispatched: Dispatched<HandlerResult[]>; worker: number }> = new Map()

Protected listeners

Protected maxConcurrentPerWorker

maxConcurrentPerWorker: number

Private Readonly messages

messages: TinyQueue<MessageType> = new TinyQueue([], (a: MessageType, b: MessageType) => {if (a.message.type === "atomist:command" && b.message.type !== "atomist:command") {return -1;} else if (a.message.type !== "atomist:command" && b.message.type === "atomist:command") {return 1;} else {return a.ts - b.ts;}})

Protected numWorkers

numWorkers: number

Private Optional registration

Private replaceWorkers

replaceWorkers: boolean = true

Private shutdownInitiated

shutdownInitiated: boolean = false

Private Readonly webSocketLifecycle

webSocketLifecycle: WebSocketLifecycle

Methods

Private assignWorker

  • assignWorker(): Worker | undefined

Protected clearNamespace

  • clearNamespace(): void

Protected createAndWrapMessageClient

Protected createGraphClient

Protected createMessageClient

Protected invokeCommand

Protected invokeEvent

onConnect

  • onConnect(ws: WebSocket): void

onDisconnect

  • onDisconnect(): void

onRegistration

processCommand

processEvent

Private queueLength

  • queueLength(): number

Private reportQueueLength

  • reportQueueLength(): void

run

  • run(): Promise<any>

Private scheduleBackoffCheck

  • scheduleBackoffCheck(): void

Private scheduleQueueLength

  • scheduleQueueLength(): void

sendCommandStatus

sendEventStatus

Protected sendStatusMessage

Protected setupNamespace

  • setupNamespace(request: any, automations: AutomationServer, invocationId?: string, ts?: number): { correlationId: any; invocationId: string; name: string; operation: any; ts: number; version: string; workspaceId: any; workspaceName: any }

Private startMessage

  • startMessage(): void

Private terminateWorkers

  • terminateWorkers(gracePeriod: number): Promise<void>

Generated using TypeDoc