SlideShare a Scribd company logo
1 of 43
Async
                       connected programs




• No more callbacks!
C# 4.0 + VB 10.0
                                       Dynamic + Language Parity

          C# 3.0 + VB 9.0
                                 Language Integrated Query

    C# 2.0 + VB 8.0
                            Generics

C# 1.0 + VB 7.0
                       Managed Code
Declarative




Dynamic       Concurrent
C# 5.0 + VB 11.0
                                           Asynchronous Programming

              C# 4.0 + VB 10.0
                                       Dynamic + Language Parity

          C# 3.0 + VB 9.0
                                 Language Integrated Query

    C# 2.0 + VB 8.0
                            Generics

C# 1.0 + VB 7.0
                       Managed Code
var data = DownloadData(...);
ProcessData(data);




DownloadDataAsync(... , data => {
    ProcessData(data);
});
var data = DownloadData(...);
ProcessData(data);




DownloadDataAsync(... , data => {
    ProcessData(data);
});
Demo
async void DoWorkAsync() {
    var t1 = ProcessFeedAsync("www.acme.com/rss");
    var t2 = ProcessFeedAsync("www.xyznews.com/rss");
    await Task.WhenAll(t1, t2);
    DisplayMessage("Done");
}                                     async Task ProcessFeedAsync(string url) {
                                          var text = await DownloadFeedAsync(url);
                                          var doc = ParseFeedIntoDoc(text);
                                          await SaveDocAsync(doc);
                                          ProcessLog.WriteEntry(url);
                                      }
async void DoWorkAsync() {
    var t1 = ProcessFeedAsync("www.acme.com/rss");
    var t2 = ProcessFeedAsync("www.xyznews.com/rss");
    await Task.WhenAll(t1, t2);
    DisplayMessage("Done");
}                                     async Task ProcessFeedAsync(string url) {
                                          var text = await DownloadFeedAsync(url);
                                          var doc = ParseFeedIntoDoc(text);
                                          await SaveDocAsync(doc);
                                          ProcessLog.WriteEntry(url);
                                      }
async void DoWorkAsync() {
    var t1 = ProcessFeedAsync("www.acme.com/rss");
    var t2 = ProcessFeedAsync("www.xyznews.com/rss");
    await Task.WhenAll(t1, t2);
    DisplayMessage("Done");
}                                     async Task ProcessFeedAsync(string url) {
                                          var text = await DownloadFeedAsync(url);
                                          var doc = ParseFeedIntoDoc(text);
                                          await SaveDocAsync(doc);
                                          ProcessLog.WriteEntry(url);
                                      }
async void DoWorkAsync() {
    var t1 = ProcessFeedAsync("www.acme.com/rss");
    var t2 = ProcessFeedAsync("www.xyznews.com/rss");
    await Task.WhenAll(t1, t2);
    DisplayMessage("Done");
}                                     async Task ProcessFeedAsync(string url) {
                                          var text = await DownloadFeedAsync(url);
                                          var doc = ParseFeedIntoDoc(text);
                                          await SaveDocAsync(doc);
                                          ProcessLog.WriteEntry(url);
                                      }
async void DoWorkAsync() {
    var t1 = ProcessFeedAsync("www.acme.com/rss");
    var t2 = ProcessFeedAsync("www.xyznews.com/rss");
    await Task.WhenAll(t1, t2);
    DisplayMessage("Done");
}                                     async Task ProcessFeedAsync(string url) {
                                          var text = await DownloadFeedAsync(url);
                                          var doc = ParseFeedIntoDoc(text);
                                          await SaveDocAsync(doc);
                                          ProcessLog.WriteEntry(url);
                                      }
async void DoWorkAsync() {
    var t1 = ProcessFeedAsync("www.acme.com/rss");
    var t2 = ProcessFeedAsync("www.xyznews.com/rss");
    await Task.WhenAll(t1, t2);
    DisplayMessage("Done");
}                                     async Task ProcessFeedAsync(string url) {
                                          var text = await DownloadFeedAsync(url);
                                          var doc = ParseFeedIntoDoc(text);
                                          await SaveDocAsync(doc);
                                          ProcessLog.WriteEntry(url);
                                      }
async void DoWorkAsync() {
    var t1 = ProcessFeedAsync("www.acme.com/rss");
    var t2 = ProcessFeedAsync("www.xyznews.com/rss");
    await Task.WhenAll(t1, t2);
    DisplayMessage("Done");
}                                     async Task ProcessFeedAsync(string url) {
                                          var text = await DownloadFeedAsync(url);
                                          var doc = ParseFeedIntoDoc(text);
                                          await SaveDocAsync(doc);
                                          ProcessLog.WriteEntry(url);
                                      }
async void DoWorkAsync() {
    var t1 = ProcessFeedAsync("www.acme.com/rss");
    var t2 = ProcessFeedAsync("www.xyznews.com/rss");
    await Task.WhenAll(t1, t2);
    DisplayMessage("Done");
}                                     async Task ProcessFeedAsync(string url) {
                                          var text = await DownloadFeedAsync(url);
                                          var doc = ParseFeedIntoDoc(text);
                                          await SaveDocAsync(doc);
                                          ProcessLog.WriteEntry(url);
                                      }




                  
async void DoWorkAsync() {
    var t1 = ProcessFeedAsync("www.acme.com/rss");
    var t2 = ProcessFeedAsync("www.xyznews.com/rss");
    await Task.WhenAll(t1, t2);
    DisplayMessage("Done");
}                                     async Task ProcessFeedAsync(string url) {
                                          var text = await DownloadFeedAsync(url);
                                          var doc = ParseFeedIntoDoc(text);
                                          await SaveDocAsync(doc);
                                          ProcessLog.WriteEntry(url);
                                      }




                  
async void DoWorkAsync() {
    var t1 = ProcessFeedAsync("www.acme.com/rss");
    var t2 = ProcessFeedAsync("www.xyznews.com/rss");
    await Task.WhenAll(t1, t2);
    DisplayMessage("Done");
}                                     async Task ProcessFeedAsync(string url) {
                                          var text = await DownloadFeedAsync(url);
                                          var doc = ParseFeedIntoDoc(text);
                                          await SaveDocAsync(doc);
                                          ProcessLog.WriteEntry(url);
                                      }




                                  
async void DoWorkAsync() {
    var t1 = ProcessFeedAsync("www.acme.com/rss");
    var t2 = ProcessFeedAsync("www.xyznews.com/rss");
    await Task.WhenAll(t1, t2);
    DisplayMessage("Done");
}                                     async Task ProcessFeedAsync(string url) {
                                          var text = await DownloadFeedAsync(url);
                                          var doc = ParseFeedIntoDoc(text);
                                          await SaveDocAsync(doc);
                                          ProcessLog.WriteEntry(url);
                                      }




                                  
async void DoWorkAsync() {
    var t1 = ProcessFeedAsync("www.acme.com/rss");
    var t2 = ProcessFeedAsync("www.xyznews.com/rss");
    await Task.WhenAll(t1, t2);
    DisplayMessage("Done");
}                                     async Task ProcessFeedAsync(string url) {
                                          var text = await DownloadFeedAsync(url);
                                          var doc = ParseFeedIntoDoc(text);
                                          await SaveDocAsync(doc);
                                          ProcessLog.WriteEntry(url);
                                      }


                



                                  
async void DoWorkAsync() {
    var t1 = ProcessFeedAsync("www.acme.com/rss");
    var t2 = ProcessFeedAsync("www.xyznews.com/rss");
    await Task.WhenAll(t1, t2);
    DisplayMessage("Done");
}                                     async Task ProcessFeedAsync(string url) {
                                          var text = await DownloadFeedAsync(url);
                                          var doc = ParseFeedIntoDoc(text);
                                          await SaveDocAsync(doc);
                                          ProcessLog.WriteEntry(url);
                                      }


                



                                 
async void DoWorkAsync() {
    var t1 = ProcessFeedAsync("www.acme.com/rss");
    var t2 = ProcessFeedAsync("www.xyznews.com/rss");
    await Task.WhenAll(t1, t2);
    DisplayMessage("Done");
}                                     async Task ProcessFeedAsync(string url) {
                                          var text = await DownloadFeedAsync(url);
                                          var doc = ParseFeedIntoDoc(text);
                                          await SaveDocAsync(doc);
                                          ProcessLog.WriteEntry(url);
                                      }


                



                                                         
async void DoWorkAsync() {
    var t1 = ProcessFeedAsync("www.acme.com/rss");
    var t2 = ProcessFeedAsync("www.xyznews.com/rss");
    await Task.WhenAll(t1, t2);
    DisplayMessage("Done");
}                                     async Task ProcessFeedAsync(string url) {
                                          var text = await DownloadFeedAsync(url);
                                          var doc = ParseFeedIntoDoc(text);
                                          await SaveDocAsync(doc);
                                          ProcessLog.WriteEntry(url);
                                      }


               



                                                         
async void DoWorkAsync() {
    var t1 = ProcessFeedAsync("www.acme.com/rss");
    var t2 = ProcessFeedAsync("www.xyznews.com/rss");
    await Task.WhenAll(t1, t2);
    DisplayMessage("Done");
}                                     async Task ProcessFeedAsync(string url) {
                                          var text = await DownloadFeedAsync(url);
                                          var doc = ParseFeedIntoDoc(text);
                                          await SaveDocAsync(doc);
                                          ProcessLog.WriteEntry(url);
                                      }


                    



                                                         
async void DoWorkAsync() {
    var t1 = ProcessFeedAsync("www.acme.com/rss");
    var t2 = ProcessFeedAsync("www.xyznews.com/rss");
    await Task.WhenAll(t1, t2);
    DisplayMessage("Done");
}                                     async Task ProcessFeedAsync(string url) {
                                          var text = await DownloadFeedAsync(url);
                                          var doc = ParseFeedIntoDoc(text);
                                          await SaveDocAsync(doc);
                                          ProcessLog.WriteEntry(url);
                                      }


                    



                                                         
async Task<XElement> GetRssAsync(string url) {
    var client = new WebClient();
    var task = client.DownloadStringTaskAsync(url);
    var text = await task;
    var xml = XElement.Parse(text);
    return xml;
}
async Task<XElement> GetRssAsync(string url) {
    var client = new WebClient();
    var task = client.DownloadStringTaskAsync(url);
    var text = await task;
    var xml = XElement.Parse(text);
    return xml;
}                             Task<XElement> GetRssAsync(string url) {
                                  var client = new WebClient();
                                  var task = client.DownloadStringTaskAsync(url);
                                  return task.ContinueWith(delegate
                                  {
                                      var text = task.Result;
                                      var xml = XElement.Parse(text);
                                      return xml;
                                  });
                              }
Task<XElement> GetRssAsync(string url) {
                                  var $builder = AsyncTaskMethodBuilder<XElement>.Create();
                                  var $state = 0;
async Task<XElement> GetRssAsync(string url) { $a1;
                                  TaskAwaiter<string>
    var client = new WebClient(); Action $resume = delegate {
                                      try {
    var task = client.DownloadStringTaskAsync(url);
                                          if ($state == 1) goto L1;
    var text = await task;                var client = new WebClient();
    var xml = XElement.Parse(text);       var task = client.DownloadStringTaskAsync(url);
                                          $a1 = task.GetAwaiter();
    return xml;
                                          if ($a1.IsCompleted) goto L1;
}                                         $state = 1;
                                          $a1.OnCompleted($resume);
                                          return;
                                      L1: var text = $a1.GetResult();
                                          var xml = XElement.Parse(text);
                                          $builder.SetResult(xml);
                                      }
                                      catch (Exception $ex) { $builder.SetException($ex); }
                                  };
                                  $resume();
                                  return $builder.Task;
                              }
Task<XElement> GetRssAsync(string url) {
                                  var $builder = AsyncTaskMethodBuilder<XElement>.Create();
                                  var $state = 0;
async Task<XElement> GetRssAsync(string url) { $a1;
                                  TaskAwaiter<string>
    var client = new WebClient(); Action $resume = delegate {
                                      try {
    var task = client.DownloadStringTaskAsync(url);
                                          if ($state == 1) goto L1;
    var text = await task;                var client = new WebClient();
    var xml = XElement.Parse(text);       var task = client.DownloadStringTaskAsync(url);
                                          $a1 = task.GetAwaiter();
    return xml;
                                          if ($a1.IsCompleted) goto L1;
}                                         $state = 1;
                                          $a1.OnCompleted($resume);
                                          return;
                                      L1: var text = $a1.GetResult();
                                          var xml = XElement.Parse(text);
                                          $builder.SetResult(xml);
                                      }
                                      catch (Exception $ex) { $builder.SetException($ex); }
                                  };
                                  $resume();
                                  return $builder.Task;
                              }
Others…




Windows
Presentation      ASP.NET
Foundation
try {
    string[] videoUrls = await ScrapeYoutubeAsync(url);    // Network-bound
    Task<Video> t1 = DownloadVideoAsync(videoUrls[0]);     // Start two downloads
    Task<Video> t2 = DownloadVideoAsync(videoUrls[1]);
    Video[] vids = await Task.WhenAll(t1, t2);             // Wait for both
    Video v = await MashupVideosAsync(vids[0], vids[1]);   // CPU-bound
    await v.SaveAsync(textbox.Text);                       // IO-bound
}
catch (WebException ex) {
    ReportError(ex);
}
C# 5.0 + VB 11.0
                                            Asynchronous Programming
              C# 4.0 + VB 10.0
                                       Dynamic + Language Parity
          C# 3.0 + VB 9.0
                                 Language Integrated Query

     C# 2.0 + VB 8.0
                            Generics

C# 1.0 + VB 7.0
                       Managed Code
Meta-programming                                  Read-Eval-Print Loop
                             Class


                   public               Foo

    Language                   Field               DSL Embedding
   Object Model
                   private                    X

                               string




   Source                                                   .NET
     File
  Source code                                             Assembly
                                                          Source code
  Source code         Compiler                            Source code
Demo
http://aka.ms/mbl-tech

http://aka.ms/mbl-tech/devprev

http://aka.ms/mbl-tech/html5
Visual Studio Async CTP http://msdn.com/async
Microsoft “Roslyn” CTP http://msdn.com/roslyn
Students to Business Day 2012: Alex Turner

More Related Content

What's hot

What's hot (14)

Like loggly using open source
Like loggly using open sourceLike loggly using open source
Like loggly using open source
 
Journée DevOps : Des dashboards pour tous avec ElasticSearch, Logstash et Kibana
Journée DevOps : Des dashboards pour tous avec ElasticSearch, Logstash et KibanaJournée DevOps : Des dashboards pour tous avec ElasticSearch, Logstash et Kibana
Journée DevOps : Des dashboards pour tous avec ElasticSearch, Logstash et Kibana
 
Networking and Go: An Engineer's Journey (Strangeloop 2019)
Networking and Go: An Engineer's Journey (Strangeloop 2019)Networking and Go: An Engineer's Journey (Strangeloop 2019)
Networking and Go: An Engineer's Journey (Strangeloop 2019)
 
.NET @ apache.org
 .NET @ apache.org .NET @ apache.org
.NET @ apache.org
 
Managing Your Security Logs with Elasticsearch
Managing Your Security Logs with ElasticsearchManaging Your Security Logs with Elasticsearch
Managing Your Security Logs with Elasticsearch
 
Node.js cluster
Node.js clusterNode.js cluster
Node.js cluster
 
Web program-peformance-optimization
Web program-peformance-optimizationWeb program-peformance-optimization
Web program-peformance-optimization
 
Logstash family introduction
Logstash family introductionLogstash family introduction
Logstash family introduction
 
Logstash: Get to know your logs
Logstash: Get to know your logsLogstash: Get to know your logs
Logstash: Get to know your logs
 
Time tested php with libtimemachine
Time tested php with libtimemachineTime tested php with libtimemachine
Time tested php with libtimemachine
 
Introduction to redis - version 2
Introduction to redis - version 2Introduction to redis - version 2
Introduction to redis - version 2
 
Relayd: a load balancer for OpenBSD
Relayd: a load balancer for OpenBSD Relayd: a load balancer for OpenBSD
Relayd: a load balancer for OpenBSD
 
ELK stack at weibo.com
ELK stack at weibo.comELK stack at weibo.com
ELK stack at weibo.com
 
swift-nio のアーキテクチャーと RxHttpClient
swift-nio のアーキテクチャーと RxHttpClientswift-nio のアーキテクチャーと RxHttpClient
swift-nio のアーキテクチャーと RxHttpClient
 

Similar to Students to Business Day 2012: Alex Turner

The Evolution of Async-Programming on .NET Platform (TUP, Full)
The Evolution of Async-Programming on .NET Platform (TUP, Full)The Evolution of Async-Programming on .NET Platform (TUP, Full)
The Evolution of Async-Programming on .NET Platform (TUP, Full)
jeffz
 
Windows Phone 8 - 3.5 Async Programming
Windows Phone 8 - 3.5 Async ProgrammingWindows Phone 8 - 3.5 Async Programming
Windows Phone 8 - 3.5 Async Programming
Oliver Scheer
 
Introduction to the New Asynchronous API in the .NET Driver
Introduction to the New Asynchronous API in the .NET DriverIntroduction to the New Asynchronous API in the .NET Driver
Introduction to the New Asynchronous API in the .NET Driver
MongoDB
 
Android Studio Assignment HelpCan someone who is familiar with And.pdf
Android Studio Assignment HelpCan someone who is familiar with And.pdfAndroid Studio Assignment HelpCan someone who is familiar with And.pdf
Android Studio Assignment HelpCan someone who is familiar with And.pdf
feelinggift
 

Similar to Students to Business Day 2012: Alex Turner (20)

Welcome to an asynchronous world 1.29s
Welcome to an asynchronous world 1.29sWelcome to an asynchronous world 1.29s
Welcome to an asynchronous world 1.29s
 
Asynchronous Programming in ASP.NET
Asynchronous Programming in ASP.NETAsynchronous Programming in ASP.NET
Asynchronous Programming in ASP.NET
 
The Evolution of Async-Programming on .NET Platform (TUP, Full)
The Evolution of Async-Programming on .NET Platform (TUP, Full)The Evolution of Async-Programming on .NET Platform (TUP, Full)
The Evolution of Async-Programming on .NET Platform (TUP, Full)
 
Asynchronní programování
Asynchronní programováníAsynchronní programování
Asynchronní programování
 
Workshop: Async and Parallel in C#
Workshop: Async and Parallel in C#Workshop: Async and Parallel in C#
Workshop: Async and Parallel in C#
 
Concurrency - responsiveness in .NET
Concurrency - responsiveness in .NETConcurrency - responsiveness in .NET
Concurrency - responsiveness in .NET
 
Async Development con Visual Studio 2012
Async Development con Visual Studio 2012Async Development con Visual Studio 2012
Async Development con Visual Studio 2012
 
Windows Phone 8 - 3.5 Async Programming
Windows Phone 8 - 3.5 Async ProgrammingWindows Phone 8 - 3.5 Async Programming
Windows Phone 8 - 3.5 Async Programming
 
WebTalk - Implementing Web Services with a dedicated Java daemon
WebTalk - Implementing Web Services with a dedicated Java daemonWebTalk - Implementing Web Services with a dedicated Java daemon
WebTalk - Implementing Web Services with a dedicated Java daemon
 
Xml & Java
Xml & JavaXml & Java
Xml & Java
 
Apache Beam de A à Z
 Apache Beam de A à Z Apache Beam de A à Z
Apache Beam de A à Z
 
Introduction to Ajax programming
Introduction to Ajax programmingIntroduction to Ajax programming
Introduction to Ajax programming
 
Introduction to the New Asynchronous API in the .NET Driver
Introduction to the New Asynchronous API in the .NET DriverIntroduction to the New Asynchronous API in the .NET Driver
Introduction to the New Asynchronous API in the .NET Driver
 
동기화 시대를 뛰어넘는 비동기 프로그래밍
동기화 시대를 뛰어넘는 비동기 프로그래밍동기화 시대를 뛰어넘는 비동기 프로그래밍
동기화 시대를 뛰어넘는 비동기 프로그래밍
 
El bueno, el feo y el malo
El bueno, el feo y el maloEl bueno, el feo y el malo
El bueno, el feo y el malo
 
About Node.js
About Node.jsAbout Node.js
About Node.js
 
Binary Studio Academy: Concurrency in C# 5.0
Binary Studio Academy: Concurrency in C# 5.0Binary Studio Academy: Concurrency in C# 5.0
Binary Studio Academy: Concurrency in C# 5.0
 
Asynchronicity: concurrency. A tale of
Asynchronicity: concurrency. A tale ofAsynchronicity: concurrency. A tale of
Asynchronicity: concurrency. A tale of
 
Android Studio Assignment HelpCan someone who is familiar with And.pdf
Android Studio Assignment HelpCan someone who is familiar with And.pdfAndroid Studio Assignment HelpCan someone who is familiar with And.pdf
Android Studio Assignment HelpCan someone who is familiar with And.pdf
 
Asynchonicity: concurrency. A tale of
Asynchonicity: concurrency. A tale ofAsynchonicity: concurrency. A tale of
Asynchonicity: concurrency. A tale of
 

More from Frederik De Bruyne

#win8acad : Tiles and notifications
#win8acad : Tiles and notifications#win8acad : Tiles and notifications
#win8acad : Tiles and notifications
Frederik De Bruyne
 
#win8aca : How and when metro style apps run
#win8aca : How and when metro style apps run#win8aca : How and when metro style apps run
#win8aca : How and when metro style apps run
Frederik De Bruyne
 
#win8acad : Integrating the Windows 8 Experience with Contracts
#win8acad : Integrating the Windows 8 Experience with Contracts#win8acad : Integrating the Windows 8 Experience with Contracts
#win8acad : Integrating the Windows 8 Experience with Contracts
Frederik De Bruyne
 
#win8acad : Building Metro Style Apps with XAML for .NET Developers
#win8acad : Building Metro Style Apps with XAML for .NET Developers#win8acad : Building Metro Style Apps with XAML for .NET Developers
#win8acad : Building Metro Style Apps with XAML for .NET Developers
Frederik De Bruyne
 
#win8acad : Building a Windows 8 Metro Style UI
#win8acad : Building a Windows 8 Metro Style UI#win8acad : Building a Windows 8 Metro Style UI
#win8acad : Building a Windows 8 Metro Style UI
Frederik De Bruyne
 
#win8acad : Platform for Metro Style Apps
#win8acad : Platform for Metro Style Apps#win8acad : Platform for Metro Style Apps
#win8acad : Platform for Metro Style Apps
Frederik De Bruyne
 
Microsoft Dynamics Academic Alliance: How to win future of business
Microsoft Dynamics Academic Alliance: How to win future of businessMicrosoft Dynamics Academic Alliance: How to win future of business
Microsoft Dynamics Academic Alliance: How to win future of business
Frederik De Bruyne
 
Microsoft Dynamics Academic Alliance: ERP in Training VDAB
Microsoft Dynamics Academic Alliance: ERP in Training VDABMicrosoft Dynamics Academic Alliance: ERP in Training VDAB
Microsoft Dynamics Academic Alliance: ERP in Training VDAB
Frederik De Bruyne
 
Microsoft Dynamics Academic Alliance: Partnership Next Steps
Microsoft Dynamics Academic Alliance: Partnership Next StepsMicrosoft Dynamics Academic Alliance: Partnership Next Steps
Microsoft Dynamics Academic Alliance: Partnership Next Steps
Frederik De Bruyne
 
Microsoft Dynamics Academic Alliance: Job Roles
Microsoft Dynamics Academic Alliance: Job RolesMicrosoft Dynamics Academic Alliance: Job Roles
Microsoft Dynamics Academic Alliance: Job Roles
Frederik De Bruyne
 
Microsoft Dynamics Academic Alliance: Academic Landscape
Microsoft Dynamics Academic Alliance: Academic LandscapeMicrosoft Dynamics Academic Alliance: Academic Landscape
Microsoft Dynamics Academic Alliance: Academic Landscape
Frederik De Bruyne
 
Microsoft Dynamics Academic Alliance: Introduction
Microsoft Dynamics Academic Alliance: IntroductionMicrosoft Dynamics Academic Alliance: Introduction
Microsoft Dynamics Academic Alliance: Introduction
Frederik De Bruyne
 
Students to Business Day 2012: Maarten Balliauw
Students to Business Day 2012: Maarten BalliauwStudents to Business Day 2012: Maarten Balliauw
Students to Business Day 2012: Maarten Balliauw
Frederik De Bruyne
 
Students to Business Day 2012: Sas
Students to Business Day 2012: SasStudents to Business Day 2012: Sas
Students to Business Day 2012: Sas
Frederik De Bruyne
 
Students to Business Day 2012: Rob Miles
Students to Business Day 2012: Rob MilesStudents to Business Day 2012: Rob Miles
Students to Business Day 2012: Rob Miles
Frederik De Bruyne
 
Students to Business Day 2012: Giuliano Dore
Students to Business Day 2012: Giuliano DoreStudents to Business Day 2012: Giuliano Dore
Students to Business Day 2012: Giuliano Dore
Frederik De Bruyne
 
Students to Business Day 2012: Pieter Vanhees
Students to Business Day 2012: Pieter VanheesStudents to Business Day 2012: Pieter Vanhees
Students to Business Day 2012: Pieter Vanhees
Frederik De Bruyne
 
Students to Business Day 2012: Joe Wilson
Students to Business Day 2012: Joe WilsonStudents to Business Day 2012: Joe Wilson
Students to Business Day 2012: Joe Wilson
Frederik De Bruyne
 
Students to Business Day 2012: Wouter Devinck
Students to Business Day 2012: Wouter DevinckStudents to Business Day 2012: Wouter Devinck
Students to Business Day 2012: Wouter Devinck
Frederik De Bruyne
 

More from Frederik De Bruyne (19)

#win8acad : Tiles and notifications
#win8acad : Tiles and notifications#win8acad : Tiles and notifications
#win8acad : Tiles and notifications
 
#win8aca : How and when metro style apps run
#win8aca : How and when metro style apps run#win8aca : How and when metro style apps run
#win8aca : How and when metro style apps run
 
#win8acad : Integrating the Windows 8 Experience with Contracts
#win8acad : Integrating the Windows 8 Experience with Contracts#win8acad : Integrating the Windows 8 Experience with Contracts
#win8acad : Integrating the Windows 8 Experience with Contracts
 
#win8acad : Building Metro Style Apps with XAML for .NET Developers
#win8acad : Building Metro Style Apps with XAML for .NET Developers#win8acad : Building Metro Style Apps with XAML for .NET Developers
#win8acad : Building Metro Style Apps with XAML for .NET Developers
 
#win8acad : Building a Windows 8 Metro Style UI
#win8acad : Building a Windows 8 Metro Style UI#win8acad : Building a Windows 8 Metro Style UI
#win8acad : Building a Windows 8 Metro Style UI
 
#win8acad : Platform for Metro Style Apps
#win8acad : Platform for Metro Style Apps#win8acad : Platform for Metro Style Apps
#win8acad : Platform for Metro Style Apps
 
Microsoft Dynamics Academic Alliance: How to win future of business
Microsoft Dynamics Academic Alliance: How to win future of businessMicrosoft Dynamics Academic Alliance: How to win future of business
Microsoft Dynamics Academic Alliance: How to win future of business
 
Microsoft Dynamics Academic Alliance: ERP in Training VDAB
Microsoft Dynamics Academic Alliance: ERP in Training VDABMicrosoft Dynamics Academic Alliance: ERP in Training VDAB
Microsoft Dynamics Academic Alliance: ERP in Training VDAB
 
Microsoft Dynamics Academic Alliance: Partnership Next Steps
Microsoft Dynamics Academic Alliance: Partnership Next StepsMicrosoft Dynamics Academic Alliance: Partnership Next Steps
Microsoft Dynamics Academic Alliance: Partnership Next Steps
 
Microsoft Dynamics Academic Alliance: Job Roles
Microsoft Dynamics Academic Alliance: Job RolesMicrosoft Dynamics Academic Alliance: Job Roles
Microsoft Dynamics Academic Alliance: Job Roles
 
Microsoft Dynamics Academic Alliance: Academic Landscape
Microsoft Dynamics Academic Alliance: Academic LandscapeMicrosoft Dynamics Academic Alliance: Academic Landscape
Microsoft Dynamics Academic Alliance: Academic Landscape
 
Microsoft Dynamics Academic Alliance: Introduction
Microsoft Dynamics Academic Alliance: IntroductionMicrosoft Dynamics Academic Alliance: Introduction
Microsoft Dynamics Academic Alliance: Introduction
 
Students to Business Day 2012: Maarten Balliauw
Students to Business Day 2012: Maarten BalliauwStudents to Business Day 2012: Maarten Balliauw
Students to Business Day 2012: Maarten Balliauw
 
Students to Business Day 2012: Sas
Students to Business Day 2012: SasStudents to Business Day 2012: Sas
Students to Business Day 2012: Sas
 
Students to Business Day 2012: Rob Miles
Students to Business Day 2012: Rob MilesStudents to Business Day 2012: Rob Miles
Students to Business Day 2012: Rob Miles
 
Students to Business Day 2012: Giuliano Dore
Students to Business Day 2012: Giuliano DoreStudents to Business Day 2012: Giuliano Dore
Students to Business Day 2012: Giuliano Dore
 
Students to Business Day 2012: Pieter Vanhees
Students to Business Day 2012: Pieter VanheesStudents to Business Day 2012: Pieter Vanhees
Students to Business Day 2012: Pieter Vanhees
 
Students to Business Day 2012: Joe Wilson
Students to Business Day 2012: Joe WilsonStudents to Business Day 2012: Joe Wilson
Students to Business Day 2012: Joe Wilson
 
Students to Business Day 2012: Wouter Devinck
Students to Business Day 2012: Wouter DevinckStudents to Business Day 2012: Wouter Devinck
Students to Business Day 2012: Wouter Devinck
 

Recently uploaded

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 

Recently uploaded (20)

Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 

Students to Business Day 2012: Alex Turner

  • 1.
  • 2.
  • 3. Async connected programs • No more callbacks!
  • 4. C# 4.0 + VB 10.0 Dynamic + Language Parity C# 3.0 + VB 9.0 Language Integrated Query C# 2.0 + VB 8.0 Generics C# 1.0 + VB 7.0 Managed Code
  • 5. Declarative Dynamic Concurrent
  • 6.
  • 7. C# 5.0 + VB 11.0 Asynchronous Programming C# 4.0 + VB 10.0 Dynamic + Language Parity C# 3.0 + VB 9.0 Language Integrated Query C# 2.0 + VB 8.0 Generics C# 1.0 + VB 7.0 Managed Code
  • 8.
  • 9. var data = DownloadData(...); ProcessData(data); DownloadDataAsync(... , data => { ProcessData(data); });
  • 10. var data = DownloadData(...); ProcessData(data); DownloadDataAsync(... , data => { ProcessData(data); });
  • 11. Demo
  • 12. async void DoWorkAsync() { var t1 = ProcessFeedAsync("www.acme.com/rss"); var t2 = ProcessFeedAsync("www.xyznews.com/rss"); await Task.WhenAll(t1, t2); DisplayMessage("Done"); } async Task ProcessFeedAsync(string url) { var text = await DownloadFeedAsync(url); var doc = ParseFeedIntoDoc(text); await SaveDocAsync(doc); ProcessLog.WriteEntry(url); }
  • 13. async void DoWorkAsync() { var t1 = ProcessFeedAsync("www.acme.com/rss"); var t2 = ProcessFeedAsync("www.xyznews.com/rss"); await Task.WhenAll(t1, t2); DisplayMessage("Done"); } async Task ProcessFeedAsync(string url) { var text = await DownloadFeedAsync(url); var doc = ParseFeedIntoDoc(text); await SaveDocAsync(doc); ProcessLog.WriteEntry(url); }
  • 14. async void DoWorkAsync() { var t1 = ProcessFeedAsync("www.acme.com/rss"); var t2 = ProcessFeedAsync("www.xyznews.com/rss"); await Task.WhenAll(t1, t2); DisplayMessage("Done"); } async Task ProcessFeedAsync(string url) { var text = await DownloadFeedAsync(url); var doc = ParseFeedIntoDoc(text); await SaveDocAsync(doc); ProcessLog.WriteEntry(url); }
  • 15. async void DoWorkAsync() { var t1 = ProcessFeedAsync("www.acme.com/rss"); var t2 = ProcessFeedAsync("www.xyznews.com/rss"); await Task.WhenAll(t1, t2); DisplayMessage("Done"); } async Task ProcessFeedAsync(string url) { var text = await DownloadFeedAsync(url); var doc = ParseFeedIntoDoc(text); await SaveDocAsync(doc); ProcessLog.WriteEntry(url); }
  • 16. async void DoWorkAsync() { var t1 = ProcessFeedAsync("www.acme.com/rss"); var t2 = ProcessFeedAsync("www.xyznews.com/rss"); await Task.WhenAll(t1, t2); DisplayMessage("Done"); } async Task ProcessFeedAsync(string url) { var text = await DownloadFeedAsync(url); var doc = ParseFeedIntoDoc(text); await SaveDocAsync(doc); ProcessLog.WriteEntry(url); }
  • 17. async void DoWorkAsync() { var t1 = ProcessFeedAsync("www.acme.com/rss"); var t2 = ProcessFeedAsync("www.xyznews.com/rss"); await Task.WhenAll(t1, t2); DisplayMessage("Done"); } async Task ProcessFeedAsync(string url) { var text = await DownloadFeedAsync(url); var doc = ParseFeedIntoDoc(text); await SaveDocAsync(doc); ProcessLog.WriteEntry(url); }
  • 18. async void DoWorkAsync() { var t1 = ProcessFeedAsync("www.acme.com/rss"); var t2 = ProcessFeedAsync("www.xyznews.com/rss"); await Task.WhenAll(t1, t2); DisplayMessage("Done"); } async Task ProcessFeedAsync(string url) { var text = await DownloadFeedAsync(url); var doc = ParseFeedIntoDoc(text); await SaveDocAsync(doc); ProcessLog.WriteEntry(url); }
  • 19. async void DoWorkAsync() { var t1 = ProcessFeedAsync("www.acme.com/rss"); var t2 = ProcessFeedAsync("www.xyznews.com/rss"); await Task.WhenAll(t1, t2); DisplayMessage("Done"); } async Task ProcessFeedAsync(string url) { var text = await DownloadFeedAsync(url); var doc = ParseFeedIntoDoc(text); await SaveDocAsync(doc); ProcessLog.WriteEntry(url); } 
  • 20. async void DoWorkAsync() { var t1 = ProcessFeedAsync("www.acme.com/rss"); var t2 = ProcessFeedAsync("www.xyznews.com/rss"); await Task.WhenAll(t1, t2); DisplayMessage("Done"); } async Task ProcessFeedAsync(string url) { var text = await DownloadFeedAsync(url); var doc = ParseFeedIntoDoc(text); await SaveDocAsync(doc); ProcessLog.WriteEntry(url); } 
  • 21. async void DoWorkAsync() { var t1 = ProcessFeedAsync("www.acme.com/rss"); var t2 = ProcessFeedAsync("www.xyznews.com/rss"); await Task.WhenAll(t1, t2); DisplayMessage("Done"); } async Task ProcessFeedAsync(string url) { var text = await DownloadFeedAsync(url); var doc = ParseFeedIntoDoc(text); await SaveDocAsync(doc); ProcessLog.WriteEntry(url); }  
  • 22. async void DoWorkAsync() { var t1 = ProcessFeedAsync("www.acme.com/rss"); var t2 = ProcessFeedAsync("www.xyznews.com/rss"); await Task.WhenAll(t1, t2); DisplayMessage("Done"); } async Task ProcessFeedAsync(string url) { var text = await DownloadFeedAsync(url); var doc = ParseFeedIntoDoc(text); await SaveDocAsync(doc); ProcessLog.WriteEntry(url); }  
  • 23. async void DoWorkAsync() { var t1 = ProcessFeedAsync("www.acme.com/rss"); var t2 = ProcessFeedAsync("www.xyznews.com/rss"); await Task.WhenAll(t1, t2); DisplayMessage("Done"); } async Task ProcessFeedAsync(string url) { var text = await DownloadFeedAsync(url); var doc = ParseFeedIntoDoc(text); await SaveDocAsync(doc); ProcessLog.WriteEntry(url); }   
  • 24. async void DoWorkAsync() { var t1 = ProcessFeedAsync("www.acme.com/rss"); var t2 = ProcessFeedAsync("www.xyznews.com/rss"); await Task.WhenAll(t1, t2); DisplayMessage("Done"); } async Task ProcessFeedAsync(string url) { var text = await DownloadFeedAsync(url); var doc = ParseFeedIntoDoc(text); await SaveDocAsync(doc); ProcessLog.WriteEntry(url); }    
  • 25. async void DoWorkAsync() { var t1 = ProcessFeedAsync("www.acme.com/rss"); var t2 = ProcessFeedAsync("www.xyznews.com/rss"); await Task.WhenAll(t1, t2); DisplayMessage("Done"); } async Task ProcessFeedAsync(string url) { var text = await DownloadFeedAsync(url); var doc = ParseFeedIntoDoc(text); await SaveDocAsync(doc); ProcessLog.WriteEntry(url); }     
  • 26. async void DoWorkAsync() { var t1 = ProcessFeedAsync("www.acme.com/rss"); var t2 = ProcessFeedAsync("www.xyznews.com/rss"); await Task.WhenAll(t1, t2); DisplayMessage("Done"); } async Task ProcessFeedAsync(string url) { var text = await DownloadFeedAsync(url); var doc = ParseFeedIntoDoc(text); await SaveDocAsync(doc); ProcessLog.WriteEntry(url); }      
  • 27. async void DoWorkAsync() { var t1 = ProcessFeedAsync("www.acme.com/rss"); var t2 = ProcessFeedAsync("www.xyznews.com/rss"); await Task.WhenAll(t1, t2); DisplayMessage("Done"); } async Task ProcessFeedAsync(string url) { var text = await DownloadFeedAsync(url); var doc = ParseFeedIntoDoc(text); await SaveDocAsync(doc); ProcessLog.WriteEntry(url); }       
  • 28. async void DoWorkAsync() { var t1 = ProcessFeedAsync("www.acme.com/rss"); var t2 = ProcessFeedAsync("www.xyznews.com/rss"); await Task.WhenAll(t1, t2); DisplayMessage("Done"); } async Task ProcessFeedAsync(string url) { var text = await DownloadFeedAsync(url); var doc = ParseFeedIntoDoc(text); await SaveDocAsync(doc); ProcessLog.WriteEntry(url); }       
  • 29. async Task<XElement> GetRssAsync(string url) { var client = new WebClient(); var task = client.DownloadStringTaskAsync(url); var text = await task; var xml = XElement.Parse(text); return xml; }
  • 30. async Task<XElement> GetRssAsync(string url) { var client = new WebClient(); var task = client.DownloadStringTaskAsync(url); var text = await task; var xml = XElement.Parse(text); return xml; } Task<XElement> GetRssAsync(string url) { var client = new WebClient(); var task = client.DownloadStringTaskAsync(url); return task.ContinueWith(delegate { var text = task.Result; var xml = XElement.Parse(text); return xml; }); }
  • 31. Task<XElement> GetRssAsync(string url) { var $builder = AsyncTaskMethodBuilder<XElement>.Create(); var $state = 0; async Task<XElement> GetRssAsync(string url) { $a1; TaskAwaiter<string> var client = new WebClient(); Action $resume = delegate { try { var task = client.DownloadStringTaskAsync(url); if ($state == 1) goto L1; var text = await task; var client = new WebClient(); var xml = XElement.Parse(text); var task = client.DownloadStringTaskAsync(url); $a1 = task.GetAwaiter(); return xml; if ($a1.IsCompleted) goto L1; } $state = 1; $a1.OnCompleted($resume); return; L1: var text = $a1.GetResult(); var xml = XElement.Parse(text); $builder.SetResult(xml); } catch (Exception $ex) { $builder.SetException($ex); } }; $resume(); return $builder.Task; }
  • 32. Task<XElement> GetRssAsync(string url) { var $builder = AsyncTaskMethodBuilder<XElement>.Create(); var $state = 0; async Task<XElement> GetRssAsync(string url) { $a1; TaskAwaiter<string> var client = new WebClient(); Action $resume = delegate { try { var task = client.DownloadStringTaskAsync(url); if ($state == 1) goto L1; var text = await task; var client = new WebClient(); var xml = XElement.Parse(text); var task = client.DownloadStringTaskAsync(url); $a1 = task.GetAwaiter(); return xml; if ($a1.IsCompleted) goto L1; } $state = 1; $a1.OnCompleted($resume); return; L1: var text = $a1.GetResult(); var xml = XElement.Parse(text); $builder.SetResult(xml); } catch (Exception $ex) { $builder.SetException($ex); } }; $resume(); return $builder.Task; }
  • 33. Others… Windows Presentation ASP.NET Foundation
  • 34.
  • 35. try { string[] videoUrls = await ScrapeYoutubeAsync(url); // Network-bound Task<Video> t1 = DownloadVideoAsync(videoUrls[0]); // Start two downloads Task<Video> t2 = DownloadVideoAsync(videoUrls[1]); Video[] vids = await Task.WhenAll(t1, t2); // Wait for both Video v = await MashupVideosAsync(vids[0], vids[1]); // CPU-bound await v.SaveAsync(textbox.Text); // IO-bound } catch (WebException ex) { ReportError(ex); }
  • 36.
  • 37. C# 5.0 + VB 11.0 Asynchronous Programming C# 4.0 + VB 10.0 Dynamic + Language Parity C# 3.0 + VB 9.0 Language Integrated Query C# 2.0 + VB 8.0 Generics C# 1.0 + VB 7.0 Managed Code
  • 38. Meta-programming Read-Eval-Print Loop Class public Foo Language Field DSL Embedding Object Model private X string Source .NET File Source code Assembly Source code Source code Compiler Source code
  • 39. Demo
  • 41. Visual Studio Async CTP http://msdn.com/async
  • 42. Microsoft “Roslyn” CTP http://msdn.com/roslyn