Your SlideShare is downloading. ×
  • Like
20131004 - Async await by Howard
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×

Now you can save presentations on your phone or tablet

Available for both IPhone and Android

Text the download link to your phone

Standard text messaging rates apply

20131004 - Async await by Howard

  • 127 views
Published

20131004_Async await - howard

20131004_Async await - howard

Published in Technology , Design
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
    Be the first to like this
No Downloads

Views

Total Views
127
On SlideShare
0
From Embeds
0
Number of Embeds
0

Actions

Shares
Downloads
5
Comments
0
Likes
0

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

  • 1. Async Await Howard 2013/10/04
  • 2. Async Methods Are Easier toWrite • The Async and Await keywords inVisual Basic and the async and await keywords in C# are the heart of async programming. By using those two keywords, you can use resources in the .NET Framework or theWindows Runtime to create an asynchronous method almost as easily as you create a synchronous method. Asynchronous methods that you define by using async and await are referred to as async methods.
  • 3. Async Methods Are Easier toWrite • The following characteristics summarize what makes the previous example an async method. • The method signature includes an Async or async modifier. • The name of an async method, by convention, ends with an "Async" suffix. • The return type is one of the following types: • Task<TResult> if your method has a return statement in which the operand has typeTResult. • Task if your method has no return statement or has a return statement with no operand. • Void (a Sub inVisual Basic) if you're writing an async event handler. • The method usually includes at least one await expression, which marks a point where the method can't continue until the awaited asynchronous operation is complete.
  • 4. Async Await – WebClient sample
  • 5. What Happens in an Async Method •
  • 6. Thread
  • 7. Thread • 開啟Thread 的地方,也很難從呼叫的方法取得回傳值
  • 8. Task
  • 9. Async Await
  • 10. References • http://msdn.microsoft.com/zh- tw/library/hh191443.aspx#BKMK_WhatHappensUnderstandinganAsyncMe thod • http://msdn.microsoft.com/en-us/library/vstudio/hh191443.aspx • http://studyhost.blogspot.tw/2012/06/metro-style-appnet-45.html