本文整理汇总了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.");
}
}
示例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.");
}
}
示例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);
}
}
示例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);
}
}
示例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.");
}
}
示例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();
}
示例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);
}
}