NATS .NET Client
1.1.4
The NATS.io .NET C# Client
|
Public Member Functions | |
virtual void | Unsubscribe () |
virtual void | AutoUnsubscribe (int max) |
void | Dispose () |
override string | ToString () |
void | SetPendingLimits (long messageLimit, long bytesLimit) |
void | GetPending (out long pendingBytes, out long pendingMessages) |
void | GetMaxPending (out long maxPendingBytes, out long maxPendingMessages) |
void | ClearMaxPending () |
Task | DrainAsync () |
Task | DrainAsync (int timeout) |
void | Drain () |
void | Drain (int timeout) |
void | Unsubscribe () |
void | AutoUnsubscribe (int max) |
void | SetPendingLimits (long messageLimit, long bytesLimit) |
void | GetPending (out long pendingBytes, out long pendingMessages) |
void | GetMaxPending (out long maxPendingBytes, out long maxPendingMessages) |
void | ClearMaxPending () |
void | Drain () |
void | Drain (int timeout) |
Task | DrainAsync () |
Task | DrainAsync (int timeout) |
Static Public Member Functions | |
static bool | IsValidSubject (string subject) |
static bool | IsValidPrefix (string prefix) |
static bool | IsValidQueueGroupName (string queueGroup) |
Protected Member Functions | |
long | tallyDeliveredMessage (Msg msg) |
virtual void | Dispose (bool disposing) |
Properties | |
long | Sid [get] |
string | Subject [get] |
string | Queue [get] |
Connection | Connection [get] |
bool | IsValid [get] |
int | QueuedMessageCount [get] |
long | PendingByteLimit [get, set] |
long | PendingMessageLimit [get, set] |
long | PendingBytes [get] |
long | PendingMessages [get] |
long | MaxPendingBytes [get] |
long | MaxPendingMessages [get] |
long | Delivered [get] |
long | Dropped [get] |
Properties inherited from NATS.Client.ISubscription | |
long | Sid [get] |
string | Subject [get] |
string | Queue [get] |
Connection | Connection [get] |
bool | IsValid [get] |
int | QueuedMessageCount [get] |
long | PendingByteLimit [get, set] |
long | PendingMessageLimit [get, set] |
long | PendingBytes [get] |
long | PendingMessages [get] |
long | MaxPendingBytes [get] |
long | MaxPendingMessages [get] |
long | Delivered [get] |
long | Dropped [get] |
Represents interest in a NATS topic. This class should not be used directly.
|
virtual |
Issues an automatic call to Unsubscribe when max messages have been received.
This can be useful when sending a request to an unknown number of subscribers. Connection's Request methods use this functionality.
max | The maximum number of messages to receive on the subscription before calling Unsubscribe. Values less than or equal to zero (0 ) unsubscribe immediately. |
NATSBadSubscriptionException | There is no longer an associated Connection for this ISubscription. |
Implements NATS.Client.ISubscription.
Reimplemented in NATS.Client.AsyncSubscription.
void NATS.Client.Subscription.Dispose | ( | ) |
Releases all resources used by the Subscription.
This method unsubscribes from the subject, to release resources.
|
protectedvirtual |
Unsubscribes the subscription and optionally releases the managed resources.
disposing | true to release both managed and unmanaged resources; false to release only unmanaged resources. |
void NATS.Client.Subscription.Drain | ( | ) |
Drains a subscription for gracefully unsubscribing.
This method unsubscribes the subscriber and drains all remaining messages.
Implements NATS.Client.ISubscription.
void NATS.Client.Subscription.Drain | ( | int | timeout | ) |
Drains a subscription for gracefully unsubscribing.
timeout | The duration in milliseconds to wait while draining. |
///
Implements NATS.Client.ISubscription.
Task NATS.Client.Subscription.DrainAsync | ( | ) |
Drains a subscription for gracefully unsubscribing.
This method unsubscribes the subscriber and drains all remaining messages.
Implements NATS.Client.ISubscription.
Task NATS.Client.Subscription.DrainAsync | ( | int | timeout | ) |
Drains a subscription for gracefully unsubscribing.
timeout | The duration in milliseconds to wait while draining. |
///
Implements NATS.Client.ISubscription.
void NATS.Client.Subscription.GetMaxPending | ( | out long | maxPendingBytes, |
out long | maxPendingMessages | ||
) |
Returns the maximum number of pending bytes and messages during the life of the Subscription.
maxPendingBytes | When this method returns, maxPendingBytes will contain the current maximum pending bytes. |
maxPendingMessages | When this method returns, maxPendingBytes will contain the current maximum pending messages. |
Implements NATS.Client.ISubscription.
void NATS.Client.Subscription.GetPending | ( | out long | pendingBytes, |
out long | pendingMessages | ||
) |
Returns the yet processed pending byte and message counts.
pendingBytes | When this method returns, pendingBytes will contain the count of bytes not yet processed on the ISubscription. |
pendingMessages | When this method returns, pendingMessages will contain the count of messages not yet processed on the ISubscription. |
Implements NATS.Client.ISubscription.
|
static |
Checks if a prefix is valid.
prefix |
|
static |
Checks if the queue group name is valid.
queueGroup |
|
static |
Checks if a subject is valid.
subject | The subject to check |
void NATS.Client.Subscription.SetPendingLimits | ( | long | messageLimit, |
long | bytesLimit | ||
) |
Sets the limits for pending messages and bytes for this instance. Any value less than or equal to zero means unlimited and will be stored as -1.
messageLimit | The maximum number of pending messages. |
bytesLimit | The maximum number of pending bytes of payload. |
Implements NATS.Client.ISubscription.
|
protected |
Implementors should call this method when msg has been delivered to an ISubscription.
Caller must lock on mu.
msg | The Msg object delivered to a ISubscription. |
override string NATS.Client.Subscription.ToString | ( | ) |
Returns a string that represents the current instance.
|
virtual |
Removes interest in the Subject.
NATSBadSubscriptionException | There is no longer an associated Connection |
NATSConnectionDrainingException | The Connection is draining. for this ISubscription. |
Implements NATS.Client.ISubscription.
Reimplemented in NATS.Client.AsyncSubscription.
|
get |
Gets the number of known dropped messages for this instance.
This will correspond to the messages dropped by violations of PendingByteLimit and/or PendingMessageLimit. If the NATS server declares the connection a slow consumer, the count may not be accurate.
Implements NATS.Client.ISubscription.
|
getset |
Gets or sets the maximum allowed count of pending bytes.
The pending byte limit if greater than 0 or -1 for unlimited.
Implements NATS.Client.ISubscription.
|
getset |
Gets or sets the maximum allowed count of pending messages.
The pending message limit if greater than 0 or -1 for unlimited.
Implements NATS.Client.ISubscription.
|
get |
Gets the optional queue group name.
If present, all subscriptions with the same name will form a distributed queue, and each message will only be processed by one member of the group.
Implements NATS.Client.ISubscription.
|
get |
Gets the number of messages remaining in the delivery queue.
NATSBadSubscriptionException | There is no longer an associated Connection for this ISubscription. |
Implements NATS.Client.ISubscription.