Beispiel #1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="publisher"></param>
        /// <param name="subscriber"></param>
        /// <param name="streamNames"></param>
        public static void Subscribe(this IJsonPublisher publisher, IJsonSubscriber subscriber, IEnumerable <string> streamNames)
        {
            Throw.IfNull(publisher, nameof(publisher));
            Throw.IfNull(streamNames, nameof(streamNames));

            publisher.Subscribe(subscriber, streamNames.ToArray());
        }
Beispiel #2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="publisher"></param>
        /// <param name="streamNames"></param>
        public static void Subscribe(this IJsonPublisher publisher, params string[] streamNames)
        {
            Throw.IfNull(publisher, nameof(publisher));
            Throw.IfNull(streamNames, nameof(streamNames));

            if (!streamNames.Any())
            {
                throw new ArgumentException($"{nameof(IJsonPublisher)}.{nameof(Subscribe)}(params string[]): At least one stream name must be specified.");
            }

            publisher.Subscribe(null, streamNames);
        }