Skip to Content
Microsoft Windows Workflow Foundation 4.0 Cookbook
book

Microsoft Windows Workflow Foundation 4.0 Cookbook

by Andrew Zhu
September 2010
Intermediate to advanced content levelIntermediate to advanced
272 pages
5h 16m
English
Packt Publishing
Content preview from Microsoft Windows Workflow Foundation 4.0 Cookbook

Creating an Asynchronous HTTP Get activity

The WebRequest class enables us to make an HTTP request in code. Usually, every WebRequest call requires some time span—several seconds or even minutes. If there is only one request, we can wait for the response. But what are we going to do if we have to make more requests, say 100—every request uses several seconds, and so 100 requests will hang our program.

Then we come up with a good idea: why not use multiple threads with one request for each thread? But it is quite expensive to initialize a thread. If one is writing.NET-managed code, each thread will take up 1MB memory and so 100 threads will use up 100MB memory! Apparently, multiple threads are not an option. So what should we do? In this task, ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Essential Windows Workflow Foundation

Essential Windows Workflow Foundation

Dharma Shukla, Bob Schmidt

Publisher Resources

ISBN: 9781849680783Other