nats-io / nats.net.v1

The official C# Client for NATS
Apache License 2.0
646 stars 151 forks source link

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

Open UliKu-philips opened 11 months ago

UliKu-philips commented 11 months ago

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