public void SendMessage(RedisChannels channel, RedisMessage message = null) { message = message ?? new DefaultRedisMessage(); string str = JsonConvert.SerializeObject(message, new JsonSerializerSettings() { TypeNameHandling = TypeNameHandling.Objects }); #if log Console.WriteLine("Sending Message: " + channel + " " + str); Console.WriteLine(); #endif database.ListLeftPush($"{channel}-bl", str); subscriber.Publish(channel.ToString(), ""); }
public Task<RedisMessage> AskQuestion(RedisChannels channelEnum, RedisMessage message = null) { var channel = channelEnum.ToString(); message = message ?? new DefaultRedisMessage(); string str = JsonConvert.SerializeObject(message, new JsonSerializerSettings() { TypeNameHandling = TypeNameHandling.Objects }); #if log Console.WriteLine("Asking Question: " + channel + " " + str); Console.WriteLine(); #endif database.ListLeftPush($"{channel}-bl", str); subscriber.Publish(channel, ""); return lateTaskManager.Build(message.Guid); }