scoped only to depth 1 and greater
Example:
void RootCauseDepth0_CausalityDepth1()
{
Port<bool> nextStep = new Port<bool>();
nextStep.Post(true);
Activate(
dispatcherQueue,
Arbiter.Receive(
false,
nextStep,
delegate(bool b)
{
Dispatcher.AddCausality(new Causality("test", _exceptionTarget));
... // do some stuff, routing exceptions to _exceptionTarget
}
)
);
// This exception should not be routed to _exceptionTarget, correct
throw new InvalidOperationException();
}
void SomeOtherFunction()
{
// This exception *definitely* won't be routed to
// _exceptionTarget, right
throw new InvalidOperationException();
}
void Example()
{
// wait for failure on our exception port
Activate(dispatcherQueue, Arbiter.Receive(false, _exceptionTarget,
ExceptionHandler));
Activate(dispatcherQueue,
Arbiter.FromHandler(
RootCauseDepth0_CausalityDepth1));
Activate(dispatcherQueue,
Arbiter.FromHandler(
SomeOtherFunction));
}
#aaron