Esempio n. 1
0
        protected static Task <long> PublishAsync(Match match)
        {
            //pub "channel" "message" d1 w30 c

            string channel       = match.Groups[1].Value;
            string message       = match.Groups[2].Value;
            string strDelayMilis = match.Groups[4].Value;
            string strRepeatCnt  = match.Groups[6].Value;
            string strCertenly   = match.Groups[7].Value;

            int delayMilis = string.IsNullOrWhiteSpace(strDelayMilis) ? 1 : int.Parse(strDelayMilis);
            int repeatCnt  = string.IsNullOrWhiteSpace(strRepeatCnt) ? 1 : int.Parse(strRepeatCnt);

            if (string.IsNullOrWhiteSpace(strCertenly))
            {
                return(_pubRedisService.PublishAsync(channel, message, delayMilis, repeatCnt));
            }
            else
            {
                return(_pubRedisService.PublishWithTwoWayHandShakeAsync(channel, message, delayMilis, repeatCnt));
            }
        }