ordered_message_processor Class

 

The new home for Visual Studio documentation is Visual Studio 2017 Documentation on docs.microsoft.com.

An ordered_message_processor is a message_processor that allows message blocks to process messages in the order they were received.

template<class T>
class ordered_message_processor : public message_processor<T>;

Parameters

T
The payload type of messages handled by the processor.

Public Typedefs

NameDescription
typeA type alias for T.

Public Constructors

NameDescription
ordered_message_processor::ordered_message_processor ConstructorConstructs an ordered_message_processor object.
ordered_message_processor::~ordered_message_processor DestructorDestroys the ordered_message_processor object.

Public Methods

NameDescription
ordered_message_processor::async_send MethodAsynchronously queues up messages and starts a processing task, if this has not been done already. (Overrides message_processor::async_send.)
ordered_message_processor::initialize MethodInitializes the ordered_message_processor object with the appropriate callback function, scheduler and schedule group.
ordered_message_processor::initialize_batched_processing MethodInitialize batched message processing
ordered_message_processor::sync_send MethodSynchronously queues up messages and starts a processing task, if this has not been done already. (Overrides message_processor::sync_send.)
ordered_message_processor::wait MethodA processor-specific spin wait used in destructors of message blocks to make sure that all asynchronous processing tasks have time to finish before destroying the block. (Overrides message_processor::wait.)

Protected Methods

NameDescription
ordered_message_processor::process_incoming_message MethodThe processing function that is called asynchronously. It dequeues messages and begins processing them. (Overrides message_processor::process_incoming_message.)

message_processor

ordered_message_processor

Header: agents.h

Namespace: concurrency

Asynchronously queues up messages and starts a processing task, if this has not been done already.

virtual void async_send(_Inout_opt_ message<T>* _Msg);

Parameters

_Msg
A pointer to a message.

Initializes the ordered_message_processor object with the appropriate callback function, scheduler and schedule group.

void initialize(
    _Inout_opt_ Scheduler* _PScheduler,
    _Inout_opt_ ScheduleGroup* _PScheduleGroup,
    _Handler_method const& _Handler);

Parameters

_PScheduler
A pointer to the scheduler to be used for scheduling light-weight tasks.

_PScheduleGroup
A pointer to the schedule group to be used for scheduling light-weight tasks.

_Handler
The handler functor invoked during callback.

Initialize batched message processing

virtual void initialize_batched_processing(
    _Handler_method const& _Processor,
    _Propagator_method const& _Propagator);

Parameters

_Processor
The processor functor invoked during callback.

_Propagator
The propagator functor invoked during callback.

Constructs an ordered_message_processor object.

ordered_message_processor();

Remarks

This ordered_message_processor will not schedule asynchronous or synchronous handlers until the initialize function is called.

Destroys the ordered_message_processor object.

virtual ~ordered_message_processor();

Remarks

Waits for all outstanding asynchronous operations before destroying the processor.

The processing function that is called asynchronously. It dequeues messages and begins processing them.

virtual void process_incoming_message();

Synchronously queues up messages and starts a processing task, if this has not been done already.

virtual void sync_send(_Inout_opt_ message<T>* _Msg);

Parameters

_Msg
A pointer to a message.

A processor-specific spin wait used in destructors of message blocks to make sure that all asynchronous processing tasks have time to finish before destroying the block.

virtual void wait();

concurrency Namespace

Show: