Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
constructor(
eventHubClient: EventHubClient,
partitionProcessor: PartitionProcessor,
private readonly _originalInitialEventPosition: EventPosition | undefined,
options: FullEventProcessorOptions
) {
this._eventHubClient = eventHubClient;
this._partitionProcessor = partitionProcessor;
this._processorOptions = options;
this._abortController = new AbortController();
}
start(): void {
if (this._isRunning) {
logger.verbose(`[${this._id}] Attempted to start an already running EventProcessor.`);
return;
}
this._isRunning = true;
this._abortController = new AbortController();
logger.verbose(`[${this._id}] Starting an EventProcessor.`);
if (targetWithoutOwnership(this._processingTarget)) {
logger.verbose(`[${this._id}] Single partition target: ${this._processingTarget}`);
this._loopTask = this._runLoopWithoutLoadBalancing(this._processingTarget);
} else {
logger.verbose(`[${this._id}] Multiple partitions, using load balancer`);
this._loopTask = this._runLoopWithLoadBalancing(
this._processingTarget,
this._abortController.signal
);
}
}