当前位置: 首页>>代码示例>>C#>>正文


C# Client.queue方法代码示例

本文整理汇总了C#中Client.queue方法的典型用法代码示例。如果您正苦于以下问题:C# Client.queue方法的具体用法?C# Client.queue怎么用?C# Client.queue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Client的用法示例。


在下文中一共展示了Client.queue方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Main

	static void Main(string[] args)
	{
		Client client = new Client("564191224aa03100070000c9",
            "SI9mlvuSEQqy6o7W5vip4SFNfx0");
		Queue queue = client.queue("Today's demo");
		Console.WriteLine("Enter messages to be sent to the IronMQ server:");
		while (true)
		{
			string msg = Console.ReadLine();
			queue.push(msg);
			Console.WriteLine("Message sent to the IronMQ server.");
		}
	}
开发者ID:resnick1223,项目名称:Web-Services-and-Cloud,代码行数:13,代码来源:IronMQSender.cs

示例2: Main

	static void Main(string[] args)
	{
		Client client = new Client(
			"4fcf860768a0197d11019380",
			"hQObnl0BZpVBxVbLODXCEHgYI4s");
		Queue queue = client.queue("NakovChatQueue");
		Console.WriteLine("Enter messages to be sent to the IronMQ server:");
		while (true)
		{
			string msg = Console.ReadLine();
			queue.push(msg);
			Console.WriteLine("Message sent to the IronMQ server.");
		}
	}
开发者ID:krstan4o,项目名称:TelerikAcademy,代码行数:14,代码来源:IronMQSender.cs

示例3: Main

	static void Main()
	{
		Client client = new Client(
			"4fcf860768a0197d11019380",
			"hQObnl0BZpVBxVbLODXCEHgYI4s");
		Queue queue = client.queue("NakovChatQueue");
		Console.WriteLine("Listening for new messages from IronMQ server:");
		while (true)
		{
			Message msg = queue.get();
			if (msg != null)
			{
				Console.WriteLine(msg.Body);
                queue.deleteMessage(msg);
			}
			Thread.Sleep(100);
		}
	}
开发者ID:krstan4o,项目名称:TelerikAcademy,代码行数:18,代码来源:IronMQReceiver.cs

示例4: Main

	static void Main()
	{
		Client client = new Client(
            "564191224aa03100070000c9",
            "SI9mlvuSEQqy6o7W5vip4SFNfx0");
		Queue queue = client.queue("Today's demo");
		Console.WriteLine("Listening for new messages from IronMQ server:");
		while (true)
		{
			Message msg = queue..get();
			if (msg != null)
			{
				Console.WriteLine(msg.Body);
                queue.deleteMessage(msg);
			}
			Thread.Sleep(100);
		}
	}
开发者ID:resnick1223,项目名称:Web-Services-and-Cloud,代码行数:18,代码来源:IronMQReceiver.cs

示例5: Main

    internal static void Main()
    {
        string decorationLine = new string('-', Console.WindowWidth);
        Console.Write(decorationLine);
        Console.WriteLine("***Simple chat application (sender)***");
        Console.Write(decorationLine);

        Client client = new Client("520f706527c7200005000001", "JySHBhogfvbKpQ8I5CkUFoY-FnI");

        Queue queue = client.queue("ChatQueue");

        Console.WriteLine("You can start entering messages");

        while (true)
        {
            string message = Console.ReadLine();
            queue.push(message);
            Console.WriteLine("Message sent to IronMQ server.");
        }
    }
开发者ID:vladislav-karamfilov,项目名称:TelerikAcademy,代码行数:20,代码来源:MessageSender.cs

示例6: Main

    public static void Main()
    {
        if (ironMQToken.IndexOf('*') > 0 || ironMQProjectId.IndexOf('*') > 0)
        {
            Console.WriteLine("Please setup your Iron MQ Token into the code");
            return;
        }

        // prepare chat
        client = new Client(ironMQProjectId, ironMQToken);
        queue = client.queue(ironMQQueueName);
        Console.WriteLine("Welcome to the SimpleChat Service\n\n");

        // arrange receiver as separate thread
        Thread receiver = new Thread(new ThreadStart(Receiver));
        receiver.Start();

        Sender();

        receiver.Abort();
    }
开发者ID:psotirov,项目名称:TelerikAcademyProjects,代码行数:21,代码来源:IronMQChat.cs

示例7: Main

    internal static void Main()
    {
        string decorationLine = new string('-', Console.WindowWidth);
        Console.Write(decorationLine);
        Console.WriteLine("***Simple chat application (receiver)***");
        Console.Write(decorationLine);

        Client client = new Client("520f706527c7200005000001", "JySHBhogfvbKpQ8I5CkUFoY-FnI");
        Queue queue = client.queue("ChatQueue");
        Console.WriteLine("Listening for new messages from IronMQ server");
        while (true)
        {
            Message message = queue.get();
            if (message != null)
            {
                Console.WriteLine(message.Body);
                queue.deleteMessage(message);
            }

            Thread.Sleep(100);
        }
    }
开发者ID:vladislav-karamfilov,项目名称:TelerikAcademy,代码行数:22,代码来源:MessageReciever.cs


注:本文中的Client.queue方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。