nats-io / nats.net

The official C# Client for NATS

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

IIterableConsumer.NextMessage: documentation does not match implementation of `timeoutMillis` parameter

UliKu-philips opened this issue · comments

Observed behavior

Definition and documentation:

Documentation states "Use a timeout of 0 to wait indefinitely"

    public interface IIterableConsumer : IMessageConsumer
    {
        /// <summary>
        /// Read the next message. Return null if the calls times out.
        /// Use a timeout of 0 to wait indefinitely. This could still be interrupted if
        /// the subscription is unsubscribed or the client connection is closed.
        /// </summary>
        /// <param name="timeoutMillis">the maximum time to wait</param>
        /// <returns>the next message for this subscriber.</returns>
        Msg NextMessage(int timeoutMillis);
    }

Channel.cs:

if (timeout < 0)
    ...

Expected behavior

Documentation should match implementation, either "Use a timeout of < 0 to wait indefinitely" or implementation in Channel.cs: if (timeout <= 0

Server and client version

Nats.Client v1.1.1

Host environment

No response

Steps to reproduce

No response