microsoft / microsoft/sqlmanagementobjects

Can TaskCompletionSource be used with Backup class?

オープン
#161 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

主要言語
C#
スター
143
フォーク
28
PR マージ指標
30日以内にマージされた PR はありません

説明

I would like a method to call Backup.SqlBackupAsync and return a TaskCompletionSource.Task in order to await the completion of the Backup process.

Currently, the Backup.Wait() method appears to be the only definitive way to know when a Backup.SqlBackupAsync(Server) call has completed entirely. Is there another way that does not require calling a blocking method?

The Complete event is unreliable because if there's an error the Complete event is never raised.

The Information event is unreliable because there's no way to know when the "final" Information event has been raised.

The PercentageComplete event is unreliable because, at least in some cases, an error causes the event to not be raised at all.

My current methodology is to call Backup.Wait() via Task.Run() and return that Task. This is functional, but not ideal, because it's creating a new thread whose entire job is to wait.

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

まず、issue に記載されている Backup.SqlBackupAsync(Server)、Backup.Wait()、および Complete、Information、PercentageComplete イベントを調査します。完了とエラーがどのように通知されるかを確認し、提案されている awaitable アプローチがブロッキング待機を避け、バックアップの結果を確実に報告することを検証します。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
csharp, sql
領域
databases
issue の種類
機能追加
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
35/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。