IHost インターフェイス
定義
プログラムの抽象化。A program abstraction.
public interface class IHost : IDisposable
public interface IHost : IDisposable
type IHost = interface
interface IDisposable
Public Interface IHost
Implements IDisposable
- 実装
プロパティ
Services |
プログラムで構成されるサービス。The programs configured services. |
メソッド
Dispose() |
アンマネージ リソースの解放またはリセットに関連付けられているアプリケーション定義のタスクを実行します。Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. (継承元 IDisposable) |
StartAsync(CancellationToken) |
プログラムを起動します。Start the program. |
StopAsync(CancellationToken) |
プログラムの正常な停止を試みます。Attempts to gracefully stop the program. |
拡張メソッド
Run(IHost) |
アプリケーションを実行し、ホストがシャットダウンするまで呼び出し元のスレッドをブロックします。Runs an application and block the calling thread until host shutdown. |
RunAsync(IHost, CancellationToken) |
アプリケーションを実行し、トークンがトリガーされたとき、またはシャットダウンがトリガーされたときにのみ完了するタスクを返します。Runs an application and returns a Task that only completes when the token is triggered or shutdown is triggered. |
Start(IHost) |
ホストを同期的に開始します。Starts the host synchronously. |
StopAsync(IHost, TimeSpan) |
指定されたタイムアウトでホストの正常な停止を試みます。Attempts to gracefully stop the host with the given timeout. |
WaitForShutdown(IHost) |
Ctrl + C または SIGTERM によってシャットダウンがトリガーされるまで、呼び出し元のスレッドをブロックします。Block the calling thread until shutdown is triggered via Ctrl+C or SIGTERM. |
WaitForShutdownAsync(IHost, CancellationToken) |
提供されたトークンによってシャットダウンがトリガーされると完了するタスクを返します。Returns a Task that completes when shutdown is triggered via the given token. |