-
Notifications
You must be signed in to change notification settings - Fork 2k
/
ISiloHost.cs
40 lines (36 loc) · 1.41 KB
/
ISiloHost.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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
using System;
using System.Threading;
using System.Threading.Tasks;
namespace Orleans.Hosting
{
/// <summary>
/// Represents a silo instance.
/// </summary>
public interface ISiloHost : IDisposable, IAsyncDisposable
{
/// <summary>
/// Starts this silo.
/// </summary>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>A <see cref="Task"/> representing the work performed.</returns>
Task StartAsync(CancellationToken cancellationToken = default(CancellationToken));
/// <summary>
/// Stops this silo.
/// </summary>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>A <see cref="Task"/> representing the work performed.</returns>
/// <remarks>
/// A stopped silo cannot be restarted.
/// If the provided <paramref name="cancellationToken"/> is canceled or becomes canceled during execution, the silo will terminate ungracefully.
/// </remarks>
Task StopAsync(CancellationToken cancellationToken = default(CancellationToken));
/// <summary>
/// Gets the service provider used by this silo.
/// </summary>
IServiceProvider Services { get; }
/// <summary>
/// Gets a <see cref="Task"/> which completes when this silo stops.
/// </summary>
Task Stopped { get; }
}
}