IInstanceContextProvider.NotifyIdle(InstanceContextIdleCallback, InstanceContext) 方法
定义
当 IsIdle(InstanceContext) 方法返回 false 时调用,以使实施者能提供回调,从而通知 WCF InstanceContext 对象的完成时间。Called when the IsIdle(InstanceContext) method returns false to enable implementers to provide a callback to notify WCF when the InstanceContext object is finished.
public:
void NotifyIdle(System::ServiceModel::Dispatcher::InstanceContextIdleCallback ^ callback, System::ServiceModel::InstanceContext ^ instanceContext);
public void NotifyIdle (System.ServiceModel.Dispatcher.InstanceContextIdleCallback callback, System.ServiceModel.InstanceContext instanceContext);
abstract member NotifyIdle : System.ServiceModel.Dispatcher.InstanceContextIdleCallback * System.ServiceModel.InstanceContext -> unit
Public Sub NotifyIdle (callback As InstanceContextIdleCallback, instanceContext As InstanceContext)
参数
- callback
- InstanceContextIdleCallback
通知 WCF InstanceContextIdleCallback 对象的关闭和回收时间的 InstanceContext 对象。The InstanceContextIdleCallback object that notifies WCF when the InstanceContext object is to be closed and recycled.
- instanceContext
- InstanceContext
当前的 InstanceContext。The current InstanceContext.
注解
NotifyIdle方法返回时,将调用方法,以 IsIdle false 使你能够为 WCF 提供一个 System.ServiceModel.Dispatcher.InstanceContextIdleCallback 对象,该对象用于通知运行时 InstanceContext 已完成其工作。The NotifyIdle method is called when the IsIdle method returns false to enable you to provide WCF with a System.ServiceModel.Dispatcher.InstanceContextIdleCallback object that you use to inform the runtime that the InstanceContext has finished its work. 当 System.ServiceModel.Dispatcher.InstanceContextIdleCallback 对象通知运行时 InstanceContext 已完成其工作时,WCF 将再次调用 IsIdle 一次。When the System.ServiceModel.Dispatcher.InstanceContextIdleCallback object notifies the runtime that the InstanceContext has finished its work, WCF calls IsIdle once again. 此循环将一直继续,直到 IsIdle 返回 true,然后上下文被关闭并回收。This cycle continues until IsIdle returns true and the context is closed and recycled.