c# - Is it okay to not await async method call? -


i have application upload files. don't want application halt during file upload, want task asynchronously. have this:

class program {     static void main(string[] args)     {         //less 5 seconds         prepareupload();     }      private static async task prepareupload()     {         //processing          await upload();          //processing     }      private static task upload()     {         var task = task.factory.startnew(() => system.threading.thread.sleep(5000));          return task;     } } 

the exceptions being treated internally, not problem.

is okay use async/away shoot , forget this?

in console app, need wait. otherwise, application exit, terminating background threads , asynchronous operations in progress.


Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -