【发布时间】:2011-08-18 13:51:13
【问题描述】:
我希望这个方法被线程化,这样我就可以设置一个计时器而不是等待它完成。这是对服务的调用。
private static void callValueEng(ValueEngineService.Contracts.ValueEngServiceParams param)
{
using (WCFServiceChannelFactory<IValueEngineService> client =
new WCFServiceChannelFactory<IValueEngineService>(
Repository.Instance.GetWCFServiceUri(typeof(IValueEngineService))))
{
client.Call(x => x.ValueManyTransactionsWithOldEngines(translatedParams));
}
}
我试过这样穿线:
System.Threading.Thread newThread;
//RestartValueEngineService();
List<TransactionInfo> currentIdsForValuation = ((counter + 7000) <= allIds.Count)
? allIds.GetRange(counter, 7000)
: allIds.GetRange(counter, allIds.Count - counter);
translatedParams.tranquoteIds = currentIdsForValuation;
// thread this out
newThread = new System.Threading.Thread(callValueEng(translatedParams));
但它是说“最好的重载匹配有一些无效的参数。”我做错了什么?
【问题讨论】:
标签: c# .net multithreading wcf