forked from dotnet/orleans
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathClientExtensions.cs
25 lines (24 loc) · 978 Bytes
/
ClientExtensions.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
using Orleans.Runtime;
using Orleans.Runtime.TestHooks;
namespace Orleans.TestingHost
{
/// <summary>
/// Extension methods for <see cref="IClusterClient"/>.
/// </summary>
internal static class ClientExtensions
{
/// <summary>
/// Returns test hooks for the specified silo.
/// </summary>
/// <param name="client">The client.</param>
/// <param name="silo">The silo.</param>
/// <returns>Test hooks for the specified silo.</returns>
public static ITestHooks GetTestHooks(this IClusterClient client, SiloHandle silo)
{
// Use the siloAddress here, not the gateway address, since we may be targeting a silo on which we are not
// connected to the gateway
var internalClient = (IInternalClusterClient) client;
return internalClient.GetSystemTarget<ITestHooksSystemTarget>(Constants.TestHooksSystemTargetType, silo.SiloAddress);
}
}
}