Class GrainClient
Client runtime for connecting to Orleans system
Inheritance
Namespace: Orleans
Assembly: Orleans.Core.Legacy.dll
Syntax
public static class GrainClient : object
Properties
| Improve this Doc View SourceClientInvokeCallback
Global pre-call interceptor function
Synchronous callback made just before a message is about to be constructed and sent by a client to a grain.
This call will be made from the same thread that constructs the message to be sent, so any thread-local settings
such as Orleans.RequestContext
will be picked up.
The action receives an InvokeMethodRequest with details of the method to be invoked, including InterfaceId and MethodId,
and a IGrain which is the GrainReference this request is being sent through
Declaration
public static ClientInvokeCallback ClientInvokeCallback { get; set; }
Property Value
Type | Description |
---|---|
ClientInvokeCallback |
Remarks
This callback method should return promptly and do a minimum of work, to avoid blocking calling thread or impacting throughput.
ConfigureLoggingDelegate
delegate to configure logging, default to none logger configured
Declaration
public static Action<ILoggingBuilder> ConfigureLoggingDelegate { get; set; }
Property Value
Type | Description |
---|---|
Action<ILoggingBuilder> |
GrainFactory
Declaration
public static IGrainFactory GrainFactory { get; }
Property Value
Type | Description |
---|---|
IGrainFactory |
Instance
Declaration
public static IClusterClient Instance { get; }
Property Value
Type | Description |
---|---|
IClusterClient |
IsInitialized
Whether the client runtime has already been initialized
Declaration
public static bool IsInitialized { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
Methods
| Improve this Doc View SourceGetResponseTimeout()
Get a timeout of responses on this Orleans client.
Declaration
public static TimeSpan GetResponseTimeout()
Returns
Type | Description |
---|---|
TimeSpan | The response timeout. |
GetStreamProvider(String)
Declaration
public static IStreamProvider GetStreamProvider(string name)
Parameters
Type | Name | Description |
---|---|---|
System.String | name |
Returns
Type | Description |
---|---|
IStreamProvider |
HardKill()
Test hook to uninitialize client without cleanup
Declaration
public static void HardKill()
Initialize()
Initializes the client runtime from the standard client configuration file.
Declaration
public static void Initialize()
Initialize(FileInfo)
Initializes the client runtime from the provided client configuration file. If an error occurs reading the specified configuration file, the initialization fails.
Declaration
public static void Initialize(FileInfo configFile)
Parameters
Type | Name | Description |
---|---|---|
FileInfo | configFile | The client configuration file. |
Initialize(IPEndPoint, Boolean)
Initializes the client runtime from the standard client configuration file using the provided gateway address. Any gateway addresses specified in the config file will be ignored and the provided gateway address wil be used instead.
Declaration
public static void Initialize(IPEndPoint gatewayAddress, bool overrideConfig = true)
Parameters
Type | Name | Description |
---|---|---|
IPEndPoint | gatewayAddress | IP address and port of the gateway silo |
System.Boolean | overrideConfig | Whether the specified gateway endpoint should override / replace the values from config file, or be additive |
Initialize(ClientConfiguration)
Initializes the client runtime from the provided client configuration object. If the configuration object is null, the initialization fails.
Declaration
public static void Initialize(ClientConfiguration config)
Parameters
Type | Name | Description |
---|---|---|
ClientConfiguration | config | A ClientConfiguration object. |
Initialize(String)
Initializes the client runtime from the provided client configuration file. If an error occurs reading the specified configuration file, the initialization fails.
Declaration
public static void Initialize(string configFilePath)
Parameters
Type | Name | Description |
---|---|---|
System.String | configFilePath | A relative or absolute pathname for the client configuration file. |
SetResponseTimeout(TimeSpan)
Set a timeout for responses on this Orleans client.
Declaration
public static void SetResponseTimeout(TimeSpan timeout)
Parameters
Type | Name | Description |
---|---|---|
TimeSpan | timeout |
Uninitialize()
Uninitializes client runtime.
Declaration
public static void Uninitialize()
Events
| Improve this Doc View SourceClusterConnectionLost
Declaration
public static event ConnectionToClusterLostHandler ClusterConnectionLost
Event Type
Type | Description |
---|---|
ConnectionToClusterLostHandler |