简体   繁体   English

WCF - 双工通道 - 请求-回复操作中的回调方法是否会出现在线程池线程中?

[英]WCF - Duplex channel - Will the callback method within request-reply operation come in thread pool thread?

I am using dual channel with NetNamedPipeBinding.我正在使用 NetNamedPipeBinding 的双通道。 I am using callback methods to give progress to the client.我正在使用回调方法向客户端提供进度。 I have couple questions.我有几个问题。 I am keen to confirm the behavior just to make sure my design doesn't have any flaws.我很想确认这种行为,以确保我的设计没有任何缺陷。

  1. Will the callback method be invoked on thread pool thread?回调方法会在线程池线程上调用吗? I looked at the debugger and it is coming from worker thread.我看着调试器,它来自工作线程。 Just want confirmation as I didnt see this detail in documentation.只是想确认一下,因为我没有在文档中看到这个细节。

  2. Can I invoke a callback within request-reply operation?我可以在请求-回复操作中调用回调吗?

    I tried this and its working.我试过这个和它的工作。 But is it recommended/ok to have a callback within request reply operation?但是是否建议/可以在请求回复操作中进行回调?

Please note that my service is running with persession instance mode and multiple concurrence mode to have effective throughput for my operations.请注意,我的服务以 persession 实例模式和多并发模式运行,以便为我的操作提供有效的吞吐量。 And the operations are thread safe.并且操作是线程安全的。

About your question #2:关于你的问题#2:

In my RPC framework design, i contains a CALLBACK-COMMAND in the response message.在我的 RPC 框架设计中,我在响应消息中包含一个 CALLBACK-COMMAND。 that's just like you say "REQUEST-REPLY".这就像你说的“请求-回复”。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM