-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reduce use of statics in SiloProviderRuntime
- Loading branch information
1 parent
3867d5a
commit afe16a5
Showing
26 changed files
with
354 additions
and
301 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
using System; | ||
using System.Threading.Tasks; | ||
using Orleans.Streams; | ||
|
||
namespace Orleans.Runtime | ||
{ | ||
/// <summary> | ||
/// Runtime client methods accessible on silos. | ||
/// </summary> | ||
internal interface ISiloRuntimeClient : IRuntimeClient | ||
{ | ||
/// <summary> | ||
/// Gets the stream directory. | ||
/// </summary> | ||
/// <returns>The stream directory.</returns> | ||
StreamDirectory GetStreamDirectory(); | ||
|
||
/// <summary> | ||
/// Retrieves the opaque identity of currently executing grain or client object. | ||
/// </summary> | ||
/// <remarks>Exposed for logging purposes.</remarks> | ||
string ExecutingEntityIdentity(); | ||
|
||
/// <summary> | ||
/// Attempts to add the provided extension handler to the currently executing grain. | ||
/// </summary> | ||
/// <param name="handler">The extension handler.</param> | ||
/// <returns><see langword="true"/> if the operation succeeded; <see langword="false" /> otherwise.</returns> | ||
bool TryAddExtension(IGrainExtension handler); | ||
|
||
/// <summary> | ||
/// Attempts to retrieve the specified extension type from the currently executing grain. | ||
/// </summary> | ||
/// <typeparam name="TExtension">The type of the extension.</typeparam> | ||
/// <param name="result">The extension, or <see langword="null" /> if it was not available.</param> | ||
/// <returns><see langword="true"/> if the operation succeeded; <see langword="false" /> otherwise.</returns> | ||
bool TryGetExtensionHandler<TExtension>(out TExtension result) where TExtension : IGrainExtension; | ||
|
||
/// <summary> | ||
/// Removes the provided extension handler from the currently executing grain. | ||
/// </summary> | ||
/// <param name="handler">The extension handler to remove.</param> | ||
void RemoveExtension(IGrainExtension handler); | ||
|
||
/// <summary> | ||
/// Binds an extension to the currently executing grain if it does not already have an extension of the specified | ||
/// <typeparamref name="TExtensionInterface"/>. | ||
/// </summary> | ||
/// <typeparam name="TExtension">The type of the extension (e.g. StreamConsumerExtension).</typeparam> | ||
/// <typeparam name="TExtensionInterface">The public interface type of the implementation.</typeparam> | ||
/// <param name="newExtensionFunc">A factory function that constructs a new extension object.</param> | ||
/// <returns>A tuple, containing first the extension and second an addressable reference to the extension's interface.</returns> | ||
Task<Tuple<TExtension, TExtensionInterface>> BindExtension<TExtension, TExtensionInterface>(Func<TExtension> newExtensionFunc) | ||
where TExtension : IGrainExtension | ||
where TExtensionInterface : IGrainExtension; | ||
} | ||
} |
Oops, something went wrong.