2019-11-06 14:16:20 +01:00
|
|
|
|
using System;
|
|
|
|
|
|
|
|
|
|
namespace Capnp.Rpc.Interception
|
|
|
|
|
{
|
2019-11-06 17:58:46 +01:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// An interception policy implements callbacks for outgoing calls and returning forwarded calls.
|
|
|
|
|
/// </summary>
|
2019-11-06 14:16:20 +01:00
|
|
|
|
public interface IInterceptionPolicy: IEquatable<IInterceptionPolicy>
|
|
|
|
|
{
|
2019-11-06 17:58:46 +01:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// A caller ("Alice") initiated a new call, which is now intercepted.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="callContext">Context object</param>
|
2019-11-06 14:16:20 +01:00
|
|
|
|
void OnCallFromAlice(CallContext callContext);
|
2019-11-06 17:58:46 +01:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Given that the intercepted call was forwarded, it returned now from the target ("Bob")
|
|
|
|
|
/// and may (or may not) be returned to the original caller ("Alice").
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="callContext"></param>
|
2019-11-06 14:16:20 +01:00
|
|
|
|
void OnReturnFromBob(CallContext callContext);
|
|
|
|
|
}
|
2020-01-11 17:56:12 +01:00
|
|
|
|
}
|