MyChannels.Nirvana.IConsumer Interface Reference

Defines an object that receive messages from the realm. More...

Inheritance diagram for MyChannels.Nirvana.IConsumer:
MyChannels.Nirvana.ITransactionalConsumer

Public Member Functions

IEnumerable< IMessageGetSynchronousReader (TimeSpan timeout)
 Creates a synchronous message reader.
 

Properties

IDestination Destination [get]
 The destination being consumed.
 

Events

EventHandler< MessageEventArgsMessageReceived
 Event handler used to asynchronously receive messages.
 

Detailed Description

Defines an object that receive messages from the realm.

Member Function Documentation

◆ GetSynchronousReader()

IEnumerable< IMessage > MyChannels.Nirvana.IConsumer.GetSynchronousReader ( TimeSpan  timeout)

Creates a synchronous message reader.

var messages = consumer.GetSynchronousReader(TimeSpan.FromMinutes(1)) foreach (var message in messages) { // process message }

Parameters
timeoutThe maximum time allowed to expire in between receiving messages.
Returns

Event Documentation

◆ MessageReceived

EventHandler<MessageEventArgs> MyChannels.Nirvana.IConsumer.MessageReceived

Event handler used to asynchronously receive messages.

consumer.MessageReceived += (sender, message) => { /*Process Message *‍/ };