microsoft / microsoft/sqlmanagementobjects
Can TaskCompletionSource be used with Backup class?
Nessuno ha ancora preso questa issue.
- Lingua principale
- C#
- Stelle
- 143
- Fork
- 28
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Descrizione
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.
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Inizia esaminando Backup.SqlBackupAsync(Server), Backup.Wait() e gli eventi Complete, Information e PercentageComplete descritti nell’issue. Determina come vengono segnalati il completamento e gli errori, quindi verifica che l’approccio awaitable proposto eviti un’attesa bloccante e riporti in modo affidabile l’esito del backup.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- csharp, sql
- Ambito
- databases
- Tipo di issue
- Funzionalità
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 35/100