C# Class StompNet.IO.StompFrameWriterWithConfirmation

A wrapper of an IStompFrameWriter (plus an IStompFrameObservable) that waits for the receipt confirmation frame before returning. If a receipt message is not received, the message is re-send in intervals of 30 seconds. The default retry interval can be changed at the constructor. This wrapper also handles the case for connect and connected frames. As the second one is the confirmation of the first one. Receipt header "~connect" is reserved. (quotation marks for clarification). Receipt headers should not be reused. It may produce unexpected results. The receipt header is assumed to already come with the frame to be written on the stream.
Inheritance: IStompFrameWriter
Mostra file Open project: krlito/StompNet

Public Properties

Property Type Description
DefRetryInterval System.TimeSpan

Public Methods

Method Description
Dispose ( ) : void
StompFrameWriterWithConfirmation ( IStompFrameWriter writer, IStompFrameObservable frameObservable, System.TimeSpan retryInterval = null ) : System

Constructor.

WriteAsync ( Frame frame, CancellationToken cancellationToken ) : Task

Write a frame and wait for its receipt frame before returning. This method does not add a receipt header if it is not included already. If the receipt header is not in the frame headers then it returns after sending the message.

Protected Methods

Method Description
Dispose ( bool disposing ) : void

Private Methods

Method Description
OnCompleted ( ) : void
OnError ( Exception error ) : void
OnNext ( Frame frame ) : void

Method Details

Dispose() public method

public Dispose ( ) : void
return void

Dispose() protected method

protected Dispose ( bool disposing ) : void
disposing bool
return void

StompFrameWriterWithConfirmation() public method

Constructor.
public StompFrameWriterWithConfirmation ( IStompFrameWriter writer, IStompFrameObservable frameObservable, System.TimeSpan retryInterval = null ) : System
writer IStompFrameWriter Frame writer.
frameObservable IStompFrameObservable Frame observable to be used to receive the confirmations.
retryInterval System.TimeSpan When sending messages that requires receipt confirmation, /// this interval specifies how much time to wait before sending the frame again if /// no receipt is received.
return System

WriteAsync() public method

Write a frame and wait for its receipt frame before returning. This method does not add a receipt header if it is not included already. If the receipt header is not in the frame headers then it returns after sending the message.
public WriteAsync ( Frame frame, CancellationToken cancellationToken ) : Task
frame StompNet.Models.Frames.Frame
cancellationToken System.Threading.CancellationToken
return Task

Property Details

DefRetryInterval public_oe static_oe property

public static TimeSpan,System DefRetryInterval
return System.TimeSpan