AMPS C# Client
5.3.5.0
AMPS C# Client for .NET
|
Public Member Functions | |
void | store (Message message) |
void | discardUpTo (ulong sequence) |
void | replay (StoreReplayer replayer) |
bool | replaySingle (StoreReplayer replayer, ulong sequence) |
long | unpersistedCount () |
ulong | getLastPersisted () |
void | flush () |
void | flush (int timeout) |
void | setMessage (Message message) |
void | setResizeHandler (PublishStoreResizeHandler handler) |
void | setErrorOnPublishGap (bool errorOnPublishGap_) |
bool | getErrorOnPublishGap () |
Represents a message store. The AMPS client uses message stores for recovery purposes. The store is responsible for maintaining the state of published messages and recovering that state in the event of a disconnection. Optionally, the store may persist message state and recover that state if the application restarts.
void AMPS.Client.Store.discardUpTo | ( | ulong | sequence | ) |
Discard messages in the store, up to and including the message specified by the passed in sequnence number. This is called by the client when it's notified a message is persisted on the server.
sequence | The highest sequence number of the messages that can be safely discarded. The specified message and all prior messages are removed from the store. |
Implemented in AMPS.Client.MemoryPublishStore, AMPS.Client.BlockPublishStore, and AMPS.Client.HybridPublishStore.
void AMPS.Client.Store.flush | ( | ) |
Wait for the store to discard everything that has been stored up to the point in time when flush is called, then return.
Implemented in AMPS.Client.HybridPublishStore, and AMPS.Client.BlockPublishStore.
void AMPS.Client.Store.flush | ( | int | timeout | ) |
Wait for the store to discard everything that has been stored up to the point in time when flush is called, then return. Throw an exception if this is not completed in the number of milliseconds specified by the timeout.
timeout | the number of milliseconds to wait for the flush |
TimedOutException | If the timeout period passes without the messages being discarded. |
Implemented in AMPS.Client.HybridPublishStore, and AMPS.Client.BlockPublishStore.
bool AMPS.Client.Store.getErrorOnPublishGap | ( | ) |
Get if a PublishStoreGapException can be thrown by the Store if there is an attempt to call discardUpTo
with a sequence number lower than the last persisted sequence number. This could occur during logon after a failover event if the new server was not current on messages due to being an async replication destination.
Implemented in AMPS.Client.MemoryPublishStore, AMPS.Client.HybridPublishStore, and AMPS.Client.BlockPublishStore.
ulong AMPS.Client.Store.getLastPersisted | ( | ) |
Return the sequence of the last persisted message.
Implemented in AMPS.Client.HybridPublishStore, and AMPS.Client.BlockPublishStore.
void AMPS.Client.Store.replay | ( | StoreReplayer | replayer | ) |
Replay all unpersisted messages in the store using the provided StoreReplayer.
replayer | The StoreReplayer used to replay undiscarded messages. |
Implemented in AMPS.Client.HybridPublishStore, and AMPS.Client.BlockPublishStore.
bool AMPS.Client.Store.replaySingle | ( | StoreReplayer | replayer, |
ulong | sequence | ||
) |
Replay the unpersisted message with the specified sequence.
replayer | The StoreReplayer used to replay the specified undiscarded message. |
sequence | The sequence number of the undiscarded message to replay. |
Implemented in AMPS.Client.BlockPublishStore, and AMPS.Client.HybridPublishStore.
void AMPS.Client.Store.setErrorOnPublishGap | ( | bool | errorOnPublishGap_ | ) |
Set if a PublishStoreGapException should be thrown by the Store if there is an attempt to call discardUpTo
with a sequence number lower than the last persisted sequence number. This could occur during logon after a failover event if the new server was not current on messages due to being an async replication destination.
errorOnPublishGap_ | Indicates if the exception should be thrown |
Implemented in AMPS.Client.HybridPublishStore, and AMPS.Client.BlockPublishStore.
void AMPS.Client.Store.setMessage | ( | Message | message | ) |
Used internally by the Client to give the store a Message implementing the correct protocol for the connection. This Message instance is also used for replay operations.
Implemented in AMPS.Client.BlockPublishStore, and AMPS.Client.HybridPublishStore.
void AMPS.Client.Store.setResizeHandler | ( | PublishStoreResizeHandler | handler | ) |
Set the resize handler for the publish store. An implementation can call the resize handler in the event that it needs to grow the size of the publish store.
Implemented in AMPS.Client.HybridPublishStore, and AMPS.Client.BlockPublishStore.
void AMPS.Client.Store.store | ( | Message | message | ) |
Store the provided message. The message sequence is the key the client can later use to replay the operation or remove the operation from the store. Implementations may assume that the index increases monotonically.
message | The message to store. |
Implemented in AMPS.Client.HybridPublishStore, and AMPS.Client.BlockPublishStore.
long AMPS.Client.Store.unpersistedCount | ( | ) |
Return the number of unpersisted messages in the store.
Implemented in AMPS.Client.HybridPublishStore, and AMPS.Client.BlockPublishStore.