NATS .NET Client  1.1.4
The NATS.io .NET C# Client
NATS.Client.ISyncSubscription Interface Reference
Inheritance diagram for NATS.Client.ISyncSubscription:
NATS.Client.ISubscription NATS.Client.JetStream.IJetStreamPullSubscription NATS.Client.JetStream.IJetStreamPushSyncSubscription NATS.Client.SyncSubscription

Public Member Functions

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

Additional Inherited Members

- 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

ISyncSubscription provides messages for a subject through calls to NextMessage() and NextMessage(int).

Member Function Documentation

◆ NextMessage() [1/2]

Msg NATS.Client.ISyncSubscription.NextMessage ( )

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

Returns
The next Msg available to a subscriber.

Implemented in NATS.Client.SyncSubscription.

◆ NextMessage() [2/2]

Msg NATS.Client.ISyncSubscription.NextMessage ( int  timeout)

Returns the next Msg available to a synchronous subscriber, or block up to a given timeout until the next one is available. Timeout less than zero means block until a message is available

Parameters
timeoutThe amount of time, in milliseconds, to wait for the next message.
Returns
The next Msg available to a subscriber.
Exceptions
NATSTimeoutExceptionWhen the call times out

Implemented in NATS.Client.SyncSubscription.


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