具有复杂的任务序列,实现错误处理可以在使用try/catch块和诸如Choice接收器之类的东西时PortSet<ActualResult, Exception>为每个小任务快速膨胀代码.
值得庆幸的是,CCR似乎提供了一种机制来以更通用的方式处理异常,用于任务图:因果关系.典型示例如下所示:
Port<Exception> exceptionPort = new Port<Exception>();
Dispatcher.AddCausality(new Causality("some job", exceptionPort));
Arbiter.Activate(
dispatcherQueue,
Arbiter.Receive(false, exceptionPort, ex => Console.WriteLine(ex)));
// now schedule the real tasks
Run Code Online (Sandbox Code Playgroud)
就我而言,我有一个使用CCR的计算密集型应用程序来实现分散/聚集场景,将"作业"分成一堆并行任务.(除此之外,这些作业中的多一个可以同时运行.)如果一个任务失败,我想要停止作业中的所有剩余任务,但不能停止任何其他任务.(如果我错过了一块拼图,结果对我没用,所以继续研究这个只会浪费CPU时间.)
问题是实施停止的最佳方法是什么.
一个想法是:
Dispatcher实例并将其保持在应用程序生命周期DispatcherQueue为每个"工作"(一组任务)创建一个新的.Causality创建后立即添加DispatcherQueue.Suspend()上DispatcherQueue.我想知道这个建议是否可以被视为最佳实践,或者是否有更好的方法来处理这种 - 可能是相当常见的 - 情景.
如果您设计一个易于横向扩展的分布式应用程序,或者您只想使用亚马逊,谷歌或微软的任何新"云计算"产品,那么您通常最终会使用一些典型的概念或组件:
现在,在设计和绘制使用这种模式的架构时,我可以使用任何常用的符号吗?甚至可以下载一些很酷的Visio模板?:)
它不一定是像UML这样的正式系统,但我认为如果有每个人都知道和理解的符号会很好,比如我们通常使用数据库或文档的形状.我认为不要将它与普通文件系统(本地或网络服务器/ SAN)或关系数据库等传统概念混淆是很重要的.
简单来说,我希望能够通过查看系统架构概述图得出有关应用程序可伸缩性或数据一致性问题的一些结论.
更新:非常感谢您的回答.我喜欢在传统符号上加上一个小"云符号"的想法.但是我打开这个帖子以防万一有人会找到特定的符号(可能在一本书中) - 或上传一些拉皮条Visio模板;)
在我的.NET客户端应用程序中,我使用Scope = User和Roaming = True的默认设置提供程序.这在大多数环境中都可以正常工作,无论客户端还是终端服务器,除了具有Citrix终端服务器场的客户.每当Properties. Settings.Default.Save()调用时,抛出以下异常:
System.UnauthorizedAccessException: Attempted to perform an unauthorized operation.
at System.Security.AccessControl.Win32.SetSecurityInfo(ResourceType type, String name, SafeHandle handle, SecurityInfos securityInformation, SecurityIdentifier owner, SecurityIdentifier group, GenericAcl sacl, GenericAcl dacl)
at System.Security.AccessControl.NativeObjectSecurity.Persist(String name, SafeHandle handle, AccessControlSections includeSections, Object exceptionContext)
at System.Security.AccessControl.NativeObjectSecurity.Persist(String name, AccessControlSections includeSections, Object exceptionContext)
at System.Security.AccessControl.FileSystemSecurity.Persist(String fullPath)
at System.Configuration.Internal.WriteFileContext.DuplicateTemplateAttributes (String source, String destination)
at System.Configuration.Internal.WriteFileContext.DuplicateFileAttributes(String source, String destination)
at System.Configuration.Internal.WriteFileContext.Complete(String filename, Boolean success)
at System.Configuration.Internal.InternalConfigHost.StaticWriteCompleted(String streamName, Boolean success, Object writeContext, Boolean assertPermissions)
at System.Configuration.Internal.DelegatingConfigHost.WriteCompleted(String streamName, Boolean …Run Code Online (Sandbox Code Playgroud) 是否可以使用NTLM以编程方式验证用户(在asp.net上)?
我希望控制网站的外观和感觉,我会在其中输入用户输入用户名/密码的表单.然后,我会查询NTLM以验证提供的信息,如果有效,则将它们重定向到虚拟目录?
.net ×1
architecture ×1
asp.net ×1
c# ×1
ccr ×1
cloud ×1
concurrency ×1
diagram ×1
distributed ×1
fileshare ×1
ldap ×1
settings ×1
visio ×1