public EventHubProcessorContext(IHostConfiguration hostConfiguration, ReceiveSettings receiveSettings, BlobContainerClient blobContainerClient, EventProcessorClient client, Func <PartitionInitializingEventArgs, Task> partitionInitializingHandler, Func <PartitionClosingEventArgs, Task> partitionClosingHandler, CancellationToken cancellationToken) : base(cancellationToken) { _blobContainerClient = blobContainerClient; _client = client; var lockContext = new ProcessorLockContext(hostConfiguration, receiveSettings); _client.PartitionInitializingAsync += async args => { await lockContext.OnPartitionInitializing(args).ConfigureAwait(false); if (partitionInitializingHandler != null) { await partitionInitializingHandler(args).ConfigureAwait(false); } }; _client.PartitionClosingAsync += async args => { if (partitionClosingHandler != null) { await partitionClosingHandler(args).ConfigureAwait(false); } await lockContext.OnPartitionClosing(args).ConfigureAwait(false); }; _client.ProcessErrorAsync += OnError; _client.ProcessEventAsync += OnMessage; ReceiveSettings = receiveSettings; _lockContext = lockContext; }
public EventDataReceiveContext(ProcessEventArgs eventArgs, ReceiveEndpointContext receiveEndpointContext, IProcessorLockContext lockContext) : base(false, receiveEndpointContext) { _eventArgs = eventArgs; _eventData = eventArgs.Data; _lockContext = lockContext; }
public EventHubDataReceiver(ReceiveEndpointContext context, IProcessorLockContext lockContext) { _context = context; _lockContext = lockContext; _dispatcher = context.CreateReceivePipeDispatcher(); }