다음을 통해 공유


QueuedMessageEventSource.Fork Method

The Fork method splits a MailItem into two branches.

Namespace: Microsoft.Exchange.Data.Transport.Routing
Assembly: Microsoft.Exchange.Data.Transport (in microsoft.exchange.data.transport.dll)

Syntax

'Declaration
Public MustOverride Sub Fork ( _
    recipients As IList(Of EnvelopeRecipient) _
)
public abstract void Fork (
    IList<EnvelopeRecipient> recipients
)
public:
virtual void Fork (
    IList<EnvelopeRecipient^>^ recipients
) abstract
public abstract void Fork (
    IList<EnvelopeRecipient> recipients
)
public abstract function Fork (
    recipients : IList<EnvelopeRecipient>
)

Parameters

  • recipients
    The list of recipients to use in the first branch. All other recipients are split off to the second branch.

Remarks

The Fork method splits a MailItem into two copies. The first copy of the MailItem, the current thread, contains only the recipients that are in both the recipients parameter and in the EnvelopeRecipientCollection of the original MailItem.

The second copy of the MailItem is a clone of the MailItem that contains the remaining recipients from the EnvelopeRecipientCollection of the original MailItem. Agents receive an OnRoutedMessage event invocation for this second copy after the processing of the first copy is finished.

When you are using the Fork method in an asynchronous event handler, make the last line of the event handler a call to the Complete method. Do not destroy the instance of the AgentAsyncContext class by assigning it to null. Doing this could result in a race condition or other unexpected results because the same instance of the agent that is used to fork the message is used to handle the forked message.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Platforms

Development Platforms

Windows XP Professional with Service Pack 2 (SP2), Windows Server 2003,

Target Platforms

Windows Server 2003