Windows Workflow Foundation (WF) 服务中的 canCreateInstance
据我了解,如果我单击canCreateInstance,那么对于到达服务的每个请求,都会创建一个新线程,并且该请求会立即执行。
如果 canCreateInstance
被禁用,那么请求将被放入队列中,并且一次处理一个。
这是正确的吗?我正在实现一个禁用 canCreateInstance
的队列。你知道有什么反对这样的事情吗?如何在禁用 canCreateInstance
的情况下启动服务
As far as I understand if I click canCreateInstance
, then for each request that comes to the service, there is created a new thread and that request is executed immediately.
If canCreateInstance
is disabled, then the requests will be put in a queue and they will be processed one at a time.
Is this correct? I am implementing a queue with canCreateInstance
disabled. Do you know anything against something like this? How Can I start the service with canCreateInstance
disabled
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
假设 WorkflowServiceHost 收到一条与初始接收活动的合约和操作名称匹配的消息,
如果 CanCreateInstance 为 true,则 WorkflowServiceHost 将创建工作流的新实例并将消息传递到接收活动。
如果 CanCreateInstance 为 false,则 WorkflowServiceHost 将抛出异常
没有上下文附加到服务的传入消息,并且当前操作未标记为“CanCreateInstance = true”。为了与此服务进行通信,请检查传入绑定是否支持上下文协议并已初始化有效的上下文。
工作流中的第一个接收活动应始终具有 CanCreateInstance = true,否则工作流无法激活。
该属性存在的原因是我们可以拥有一个既可用于激活接收又可用于持续接收的接收活动。
Given a WorkflowServiceHost receives a message matching the contract and operation name for the initial receive activity
If CanCreateInstance is true then WorkflowServiceHost will create a new instance of the workflow and deliver the message to the receive activity.
If CanCreateInstance is false then the WorkflowServiceHost will throw an exception
There is no context attached to the incoming message for the service and the current operation is not marked with "CanCreateInstance = true". In order to communicate with this service check whether the incoming binding supports the context protocol and has a valid context initialized.
The first receive activity in the workflow should always have CanCreateInstance = true otherwise the workflow cannot activate.
The reason this property exists is so we can have one Receive activity that works for both activating receives and continuing receives.