熟悉微软机器人工作室的人能否解释一下为什么处理程序操作是虚拟的,而有些被设置为非虚拟的?
[ServiceHandler(ServiceHandlerBehavior.Concurrent)]
public virtual IEnumerator<ITask> GetHandler(Get get)
{
get.ResponsePort.Post(_state);
yield break;
}
对比
[ServiceHandler(ServiceHandlerBehavior.Concurrent)]
public IEnumerator<ITask> SubscribeHandler(Subscribe subscribe)
{
SubscribeRequestType request = subscribe.Body;
LogInfo("Subscribe request from: " + request.Subscriber);
// Use the Subscription Manager to handle the subscribers
yield return Arbiter.Choice(
SubscribeHelper(_submgrPort, request, subscribe.ResponsePort),
delegate(SuccessResult success)
{
// Send a notification on successful subscription so that the
// subscriber can initialize its own state
base.SendNotificationToTarget<Replace>(request.Subscriber, _submgrPort, _state);
},
delegate(Exception e)
{
LogError(null, "Subscribe failed", e);
}
);
yield break;
}
提前致谢。