Bewerken

Share via


IServiceCall.OnCall Method

Definition

Starts the execution of the batch work implemented in this method.

public:
 void OnCall();
public void OnCall ();
abstract member OnCall : unit -> unit
Public Sub OnCall ()

Remarks

The batch work that is run in this method runs in the context and thread apartment of the activity created by the call to Activity. The batch work in this method is run by a call to either Activity.SynchronousCall or Activity.AsynchronousCall.

Caution

You must ensure that this method is thread safe in situations where the activity object created by Activity is not created with a synchronized context, because in such situations many calls to OnCall can run at the same time.

To achieve the best performance from the system, the context configuration of the activity created by Activity should be matched to the batch work performed by the OnCall method. For example, if the batch work in the OnCall method uses poolable objects, the activity created by Activity should be configured to use the multithreaded apartment (MTA).

For information about poolable objects, see the topic "Requirements for Poolable Objects" in the Platform SDK in MSDN.

Applies to