【发布时间】:2017-04-12 21:09:51
【问题描述】:
我想使用 .NET Core 将控制台应用程序创建为 WebJob,但 WebJobs SDK 在 .NET Core 中尚不可用。
有人建议我手动处理从 Azure 存储队列读取消息的情况。看起来 WebJobs SDK 所做的只是继续轮询队列。
下面的代码是这样做的基本思路吗?它看起来不是很复杂,但不确定如何更复杂。
static void Main(string[] args)
{
var runContinuously = true;
while (runContinuously)
{
ReadAndProcessMessage();
System.Threading.Thread.Sleep(1000);
};
}
private static void ReadAndProcessMessage()
{
// Read message
ReadMessage();
// Process message and handle the work
HandleWork();
}
【问题讨论】:
标签: azure console-application .net-core azure-webjobs