NATS .NET Client  1.1.4
The NATS.io .NET C# Client
NATS.Client.SyncSubscription Class Reference
Inheritance diagram for NATS.Client.SyncSubscription:
NATS.Client.Subscription NATS.Client.ISyncSubscription NATS.Client.ISubscription NATS.Client.ISubscription NATS.Client.ISubscription

Public Member Functions

virtual Msg NextMessage ()
 
virtual Msg NextMessage (int timeout)
 
- Public Member Functions inherited from NATS.Client.Subscription
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)
 
Msg NextMessage ()
 
Msg NextMessage (int timeout)
 

Additional Inherited Members

- Static Public Member Functions inherited from NATS.Client.Subscription
static bool IsValidSubject (string subject)
 
static bool IsValidPrefix (string prefix)
 
static bool IsValidQueueGroupName (string queueGroup)
 
- Protected Member Functions inherited from NATS.Client.Subscription
long tallyDeliveredMessage (Msg msg)
 
virtual void Dispose (bool disposing)
 
- Properties inherited from NATS.Client.Subscription
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]
 

Detailed Description

SyncSubscription provides messages for a subject through calls to NextMessage() and NextMessage(int). This class should not be used directly.

Member Function Documentation

◆ NextMessage() [1/2]

virtual Msg NATS.Client.SyncSubscription.NextMessage ( )
virtual

Returns the next Msg available to a synchronous subscriber, blocking until one is available.

Returns
The next Msg available to a subscriber.
Exceptions
NATSConnectionClosedExceptionThe connection to the NATS Server is closed.
NATSMaxMessagesExceptionThe maximum number of messages have been delivered to this ISyncSubscription.
NATSBadSubscriptionExceptionThe subscription is closed.
NATSSlowConsumerExceptionThe subscription has been marked as a slow consumer.

Implements NATS.Client.ISyncSubscription.

◆ NextMessage() [2/2]

virtual Msg NATS.Client.SyncSubscription.NextMessage ( int  timeout)
virtual

Returns the next Msg available to a synchronous subscriber, or block up to a given timeout until the next one is available.

Parameters
timeoutThe amount of time, in milliseconds, to wait for the next message.
Returns
The next Msg available to a subscriber.
Exceptions
NATSConnectionClosedExceptionThe connection to the NATS Server is closed.
NATSMaxMessagesExceptionThe maximum number of messages have been delivered to this ISyncSubscription.
NATSBadSubscriptionExceptionThe subscription is closed.
NATSSlowConsumerExceptionThe subscription has been marked as a slow consumer.
NATSTimeoutExceptionA timeout occurred while waiting for the next available Msg.

Implements NATS.Client.ISyncSubscription.


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