Last active
October 13, 2018 14:43
-
-
Save jesuscampos/9382b7fb549f9b213ea21ccd97bdfe72 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <summary> | |
/// Este método está vinculado a la CPU. Si se usa desde una | |
/// UI utilizar Task.Run para no bloquear la interfaz | |
/// <summary> | |
void DoWork() | |
{ | |
//... CPU-Bound work | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// consumidor UI | |
await Task.Run(() => DoWork()); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// consumidor ASP.NET / Consola | |
DoWork(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment