microsoft / microsoft/sqlmanagementobjects
Can TaskCompletionSource be used with Backup class?
Nadie ha tomado este issue todavía.
- Lenguaje dominante
- C#
- Estrellas
- 143
- Forks
- 28
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Descripción
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.
Guía de contribución
No hay ninguna guía de contribución indexada para este repositorio
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Línea de trabajo
Comienza examinando Backup.SqlBackupAsync(Server), Backup.Wait() y los eventos Complete, Information y PercentageComplete descritos en el issue. Determina cómo se indican la finalización y los errores y, a continuación, verifica que el enfoque awaitable propuesto evita una espera bloqueante e informa de forma fiable del resultado de la copia de seguridad.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- csharp, sql
- Área
- databases
- Tipo de issue
- Nueva funcionalidad
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Estado de actividad
- Estancado
- Claridad
- Bastante claro
- Aptitud para principiantes
- 35/100