azure-messaging-eventhubs
Loading...
Searching...
No Matches
Classes | Public Member Functions | List of all members
Azure::Messaging::EventHubs::Processor Class Referencefinal

Processor uses a ConsumerClient and CheckpointStore to provide automatic load balancing between multiple Processor instances, even in separate processes or on separate machines.

#include <processor.hpp>

Public Member Functions

 Processor (std::shared_ptr< ConsumerClient > consumerClient, std::shared_ptr< CheckpointStore > checkpointStore, ProcessorOptions const &options={})
 Construct a new Processor object.
 
 Processor (Processor const &other)=delete
 
Processoroperator= (Processor const &other)=delete
 
std::shared_ptr< ProcessorPartitionClientNextPartitionClient (Azure::Core::Context const &context={})
 
void Run (Core::Context const &context)
 Executes the processor.
 
void Start (Azure::Core::Context const &context={})
 Starts the processor.
 
void Stop ()
 Stops a running processor.
 
void Close (Core::Context const &context={})
 Closes the processor and cancels any current operations.
 

Constructor & Destructor Documentation

◆ Processor() [1/2]

Azure::Messaging::EventHubs::Processor::Processor ( std::shared_ptr< ConsumerClient consumerClient,
std::shared_ptr< CheckpointStore checkpointStore,
ProcessorOptions const &  options = {} 
)
Parameters
consumerClientA [ConsumerClient] that is used to receive events from the Event Hub.
checkpointStoreA [CheckpointStore] that is used to load and update checkpoints.
optionsOptional configuration for the processor.

◆ Processor() [2/2]

Azure::Messaging::EventHubs::Processor::Processor ( Processor const &  other)
delete

Construct a Processor from another Processor.

Member Function Documentation

◆ Close()

void Azure::Messaging::EventHubs::Processor::Close ( Core::Context const &  context = {})
inline

◆ NextPartitionClient()

std::shared_ptr< ProcessorPartitionClient > Azure::Messaging::EventHubs::Processor::NextPartitionClient ( Azure::Core::Context const &  context = {})

Move to the next partition client

Parameters
contextThe context to control whether this function is canceled or not.
Returns
A shared pointer to the next partition client.

NextPartitionClient will retrieve the next ProcessorPartitionClient if one is acquired or will block until a new one arrives, or the processor is stopped.

◆ operator=()

Processor & Azure::Messaging::EventHubs::Processor::operator= ( Processor const &  other)
delete

Assign a Processor to another Processor.

◆ Run()

void Azure::Messaging::EventHubs::Processor::Run ( Core::Context const &  context)
Parameters
contextThe context to control the request lifetime.
Remarks
This function will block until Stop() is called. It is intended for customers who would prefer to manage the call to Run from their own threads.

◆ Start()

void Azure::Messaging::EventHubs::Processor::Start ( Azure::Core::Context const &  context = {})
Parameters
contextThe context to control the request lifetime of the processor. Cancelling this context will stop the processor from running.
Remarks
This function starts the processor running in a new thread.

◆ Stop()

void Azure::Messaging::EventHubs::Processor::Stop ( )
Remarks
This function stops the processor. If the Start method has been called, it will wait for the thread to complete.

The documentation for this class was generated from the following files: