Exemple #1
0
        static void Main(string[] args)
        {
            using (var receiver = new Consumer<Message>("localhost", string.Empty, "add", "info", OnMessageReceived))
            {
                receiver.Open();

                Console.WriteLine("please <enter> to exit");
                Console.ReadLine();
            }
        }
        private static void Main()
        {
            Console.WriteLine("Receiver");
            ReceiverUtil.Delay();

            Consumer consumer = new Consumer(ChannelConfiguration.Name);
            consumer.Consume();

            ConsolePause.PauseForInput();
        }
        //receiver -c=hello_world
        static void Main(string[] args)
        {
            string channel = string.Empty;
            var p = new OptionSet() { { "c|channel=", "The name of the channel that we should send messages to", c => channel = c } };
            p.Parse(args);
            if (string.IsNullOrEmpty(channel))
            {
                Console.WriteLine("You must provide a channel name");
                return;
            }

            string channelName = string.Format(@".\private$\{0}", channel);

            var consumer = new Consumer(channelName);
            consumer.Consume();
        }