PreEmptive Analytics .NET API  1.3
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties Events
Public Member Functions | Properties | List of all members
PreEmptive.Analytics.Common.FlowController Class Reference

Class that used to manage the behavior of the message queue. More...

Inherits PreEmptive.Analytics.Common.IFlowController.

Public Member Functions

 FlowController ()
 Constructor for the FlowController. More...
 
bool CanStartClient ()
 Determines if the CoreClient instance should actually start queueing of messages More...
 
bool BatchHasExpired (MessageBatch batch)
 Determines if a Batch has expired and is eligible for deletion/dropping More...
 
int GetInterval (int numberOfMessages)
 Calculates the time to wait until the next automatic batching and sending of messages. More...
 
int MessagesToDrop (int currentMessageCount)
 The number of messages to drop when QueueSize has been exceeded. More...
 
bool ShouldSendNow (int messageCount)
 Determines if the queue should awaken the transmitter and start sending More...
 
virtual bool OkToTransmit ()
 Determines if messages sending is currently permitted. More...
 
virtual void OnSend (bool sendSucceeded)
 Updates the flow controller based on the success or failure of a message transmission. More...
 
virtual IFlowController Copy ()
 Creates a deep copy of the FlowController. More...
 

Properties

int QueueSize [get, set]
 The maximum number of messages that can be held in the queue. Note that this will adjust HighWater to (QueueSize * 2) / 3 More...
 
int HighWater [get, set]
 The point at which queued messages should be batched and sent. Note that if this is set to a higher value than QueueSize, then this value will be adjusted to QueueSize - 1 More...
 
int MaximumBatchSize [get, set]
 The maximum size a message batch can be, in bytes. If a batch exceeds this size, it is split into multiple batches If a single message exceeds this size, it will be discarded if transmission fails at any time More...
 
int MaximumInterval [get, set]
 The maximum amout of time the transmitter should wait between checking the message queue specified in milliseconds. More...
 
int MinimumInterval [get, set]
 The minimum amout of time the transmitter should wait between checking the message queue specified in milliseconds. Note: If this is set to a higher value than MaximumInterval, this value will be adjusted down to MaximumInterval More...
 
int Gain [get, set]
 The rate at which the interval should be changed in relation to the number of messages queued. This is an integer greater than zero that acts as a percentage. More...
 
int QuietGain [get, set]
 The rate at which the interval should be changed when the queue is empty. This is an integer greater than zero and greater than or equal to 100 that acts as a percentage. More...
 
bool Offline [get, set]
 Is the transmission of messages prohibited. More...
 
bool SupportOfflineStorage [get, set]
 Is offline storage of messages permitted. More...
 
bool SendDisabled [get, set]
 Is the transmission of messages temporarily disabled. More...
 
int MaximumSequentialFailureCount [get, set]
 The maximum number of sequential transmission failures before waiting the duration of the RetryTimeout to retry sending. More...
 
int RetryTimeout [get, set]
 The number of milliseconds to wait before allowing transmissions after a series of sequential failures. More...
 
long LastSendTime [get, set]
 Last time messages were sent specified int ticks. More...
 
int Interval [get, set]
 The time to wait between automatic batching and sending of messages specified in milliseconds. More...
 
int SequentialFailureCount [get, set]
 The current number of sequential transmission failures. More...
 
long RetryTime [get, set]
 The time when message sending will resume. Specified in ticks. More...
 
int MinimumFailureCount [get, set]
 The minimum amount of times a message should be attempted to be sent before becoming eligible for deletion from offline storage More...
 
int MinimumTimeToLive [get, set]
 The minimum age(in seconds) a message must be before it becomes eligible for deletion from offline storage More...
 
- Properties inherited from PreEmptive.Analytics.Common.IFlowController
bool SupportOfflineStorage [get]
 Is offline storage of messages permitted. More...
 
bool SendDisabled [get, set]
 Is the transmission of messages temporarily disabled. More...
 
int MaximumBatchSize [get]
 The maximum size a message batch can be, in bytes. If a batch exceeds this size, it is split into multiple batches If a single message exceeds this size, it will be discarded if transmission fails at any time More...
 

Detailed Description

Class that used to manage the behavior of the message queue.

Constructor & Destructor Documentation

PreEmptive.Analytics.Common.FlowController.FlowController ( )

Constructor for the FlowController.

Member Function Documentation

bool PreEmptive.Analytics.Common.FlowController.BatchHasExpired ( MessageBatch  batch)

Determines if a Batch has expired and is eligible for deletion/dropping

Parameters
batchThe batch to check
Returns
True if the batch should be deleted. False if it should be kept and cached

Implements PreEmptive.Analytics.Common.IFlowController.

bool PreEmptive.Analytics.Common.FlowController.CanStartClient ( )

Determines if the CoreClient instance should actually start queueing of messages

Returns
True if it should start, false if not

Implements PreEmptive.Analytics.Common.IFlowController.

virtual IFlowController PreEmptive.Analytics.Common.FlowController.Copy ( )
virtual

Creates a deep copy of the FlowController.

Returns
A new instance of IFlowController.

Implements PreEmptive.Analytics.Common.IFlowController.

int PreEmptive.Analytics.Common.FlowController.GetInterval ( int  numberOfMessages)

Calculates the time to wait until the next automatic batching and sending of messages.

Parameters
numberOfMessagesA count of the current number of queued messages.
Returns
The time interval to wait in milliseconds.

Implements PreEmptive.Analytics.Common.IFlowController.

int PreEmptive.Analytics.Common.FlowController.MessagesToDrop ( int  currentMessageCount)

The number of messages to drop when QueueSize has been exceeded.

Parameters
currentMessageCountThe current number of messages.
Returns
The number of messages to drop.

Implements PreEmptive.Analytics.Common.IFlowController.

virtual bool PreEmptive.Analytics.Common.FlowController.OkToTransmit ( )
virtual

Determines if messages sending is currently permitted.

Returns

Implements PreEmptive.Analytics.Common.IFlowController.

virtual void PreEmptive.Analytics.Common.FlowController.OnSend ( bool  sendSucceeded)
virtual

Updates the flow controller based on the success or failure of a message transmission.

Parameters
sendSucceededThe status of the message transmission.

Implements PreEmptive.Analytics.Common.IFlowController.

bool PreEmptive.Analytics.Common.FlowController.ShouldSendNow ( int  messageCount)

Determines if the queue should awaken the transmitter and start sending

Parameters
messageCount
Returns

Implements PreEmptive.Analytics.Common.IFlowController.

Property Documentation

int PreEmptive.Analytics.Common.FlowController.Gain
getset

The rate at which the interval should be changed in relation to the number of messages queued. This is an integer greater than zero that acts as a percentage.

int PreEmptive.Analytics.Common.FlowController.HighWater
getset

The point at which queued messages should be batched and sent. Note that if this is set to a higher value than QueueSize, then this value will be adjusted to QueueSize - 1

int PreEmptive.Analytics.Common.FlowController.Interval
getset

The time to wait between automatic batching and sending of messages specified in milliseconds.

long PreEmptive.Analytics.Common.FlowController.LastSendTime
getset

Last time messages were sent specified int ticks.

int PreEmptive.Analytics.Common.FlowController.MaximumBatchSize
getset

The maximum size a message batch can be, in bytes. If a batch exceeds this size, it is split into multiple batches If a single message exceeds this size, it will be discarded if transmission fails at any time

int PreEmptive.Analytics.Common.FlowController.MaximumInterval
getset

The maximum amout of time the transmitter should wait between checking the message queue specified in milliseconds.

int PreEmptive.Analytics.Common.FlowController.MaximumSequentialFailureCount
getset

The maximum number of sequential transmission failures before waiting the duration of the RetryTimeout to retry sending.

int PreEmptive.Analytics.Common.FlowController.MinimumFailureCount
getset

The minimum amount of times a message should be attempted to be sent before becoming eligible for deletion from offline storage

int PreEmptive.Analytics.Common.FlowController.MinimumInterval
getset

The minimum amout of time the transmitter should wait between checking the message queue specified in milliseconds. Note: If this is set to a higher value than MaximumInterval, this value will be adjusted down to MaximumInterval

int PreEmptive.Analytics.Common.FlowController.MinimumTimeToLive
getset

The minimum age(in seconds) a message must be before it becomes eligible for deletion from offline storage

bool PreEmptive.Analytics.Common.FlowController.Offline
getset

Is the transmission of messages prohibited.

int PreEmptive.Analytics.Common.FlowController.QueueSize
getset

The maximum number of messages that can be held in the queue. Note that this will adjust HighWater to (QueueSize * 2) / 3

int PreEmptive.Analytics.Common.FlowController.QuietGain
getset

The rate at which the interval should be changed when the queue is empty. This is an integer greater than zero and greater than or equal to 100 that acts as a percentage.

long PreEmptive.Analytics.Common.FlowController.RetryTime
getset

The time when message sending will resume. Specified in ticks.

int PreEmptive.Analytics.Common.FlowController.RetryTimeout
getset

The number of milliseconds to wait before allowing transmissions after a series of sequential failures.

bool PreEmptive.Analytics.Common.FlowController.SendDisabled
getset

Is the transmission of messages temporarily disabled.

int PreEmptive.Analytics.Common.FlowController.SequentialFailureCount
getset

The current number of sequential transmission failures.

bool PreEmptive.Analytics.Common.FlowController.SupportOfflineStorage
getset

Is offline storage of messages permitted.


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