public static async Task<string> PublishAsync(string nsqd_http_address, string topic, string message) { if (string.IsNullOrWhiteSpace(message)) { throw new ArgumentException("a message cannot be null or blank", "message"); } var uri = new Uri(nsqd_http_address); var baseUriString = uri.GetComponents(UriComponents.SchemeAndServer, UriFormat.Unescaped); var req = new NSQUtil(baseUriString); var res = await req.put(topic, message); return res; }
public static async Task<string> PublishAsync(string nsqd_http_address, string topic, IEnumerable<string> messages) { if (messages.Any() == false) { throw new ArgumentException("messages is empty", "messages"); } var uri = new Uri(nsqd_http_address); var baseUriString = uri.GetComponents(UriComponents.SchemeAndServer, UriFormat.Unescaped); var req = new NSQUtil(baseUriString); var res = await req.mput(topic, messages); return res; }
public static async Task <string> PublishAsync(string nsqd_http_address, string topic, string message) { if (string.IsNullOrWhiteSpace(message)) { throw new ArgumentException("a message cannot be null or blank", "message"); } var uri = new Uri(nsqd_http_address); var baseUriString = uri.GetComponents(UriComponents.SchemeAndServer, UriFormat.Unescaped); var req = new NSQUtil(baseUriString); var res = await req.put(topic, message); return(res); }
public static async Task <string> PublishAsync(string nsqd_http_address, string topic, IEnumerable <string> messages) { if (messages.Any() == false) { throw new ArgumentException("messages is empty", "messages"); } var uri = new Uri(nsqd_http_address); var baseUriString = uri.GetComponents(UriComponents.SchemeAndServer, UriFormat.Unescaped); var req = new NSQUtil(baseUriString); var res = await req.mput(topic, messages); return(res); }