使用ASP.Net Core 2.1 Razor Pages,使用LocalRedirect和RedirectToPage的最佳做法是什么?
当重定向到当前网站内的页面时,它们似乎可以互换使用.一个人比另一个人有优势吗?
我有一个TimerTrigger函数,并且输出绑定是Azure队列。
这个想法是,计时器每10分钟运行一次,它将查看数据库中的一个视图,并迭代返回的所有行,并将它们作为消息添加到队列中。
以下是我的示例TimerTrigger。将消息添加到队列中效果很好。
但是,在我的实际情况中,有些行将需要立即执行,而另一些行则将延迟几分钟(每行变化)。我计划通过使用VisibilityTimeout处理消息来处理延迟。
不幸的是,通过字符串进行绑定无法让我设置值。CloudQueueMessage.VisiblityTimeout(以下使用)是只读的。
#r "Microsoft.WindowsAzure.Storage"
using System;
using Microsoft.WindowsAzure.Storage.Queue;
public static void Run(TimerInfo myTimer, ICollector<CloudQueueMessage> outputQueueItem, TraceWriter log)
{
log.Info($"C# Timer trigger function executed at: {DateTime.Now}");
//- Add a message to be processed now.
CloudQueueMessage msg = new CloudQueueMessage("Now");
outputQueueItem.Add(msg);
//- Add a message to be processed later.
//- this code below won't work because NextVisibleTime is readonly.
//- is there some way to set the VisibilityTimeout property before queueing?
msg = new CloudQueueMessage("Later");
DateTime otherDate = DateTime.Now.AddMinutes(3); …Run Code Online (Sandbox Code Playgroud) 我对有关Azure队列,函数和工作器的功能有一些疑问。我不确定这是如何工作的。
场景:
理论上,当将消息添加到q通知时,应调用f-process-notification函数。
问题:
触发功能是否取代了需要工人的需求?换句话说,每当一条消息放入队列时,都会调用f-process-notification。
假设我在可见性超时为5分钟的队列中放置了一条消息。基本上,我正在对消息进行排队,但是直到5分钟后才应采取行动。队列是在将消息放入队列时立即触发f-process-notification还是仅在消息变为可见时(即,将消息放入队列后5分钟)才触发f-process-notification?