异步HttpHandlers的和WriteAsync [英] Asynchronous HttpHandlers and WriteAsync

查看:112
本文介绍了异步HttpHandlers的和WriteAsync的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在尝试与Ayende Rahien的博客这里有些code code 这表明使用异步HttpHandlers的改进可同时处理的请求数量。

I've been experimenting with some code code on Ayende Rahien's blog here which demonstrates using asynchronous HttpHandlers to improve the number of requests that can be processed concurrently.

不幸的是,我可以得到连基本的例子来工作。我得到了以下错误:

Unfortunately I can get even the basic example to work. I'm getting the following error:

System.IO.TextWriter'不包含一个定义为'WriteAsync'
  没有扩展方法'WriteAsync接受的第一个参数
  类型'System.IO.TextWriter'可以找到(是否缺少使用
  指令或程序集引用?)

'System.IO.TextWriter' does not contain a definition for 'WriteAsync' and no extension method 'WriteAsync' accepting a first argument of type 'System.IO.TextWriter' could be found (are you missing a using directive or an assembly reference?)

有关行了。

return context.Response.Output.WriteAsync("Hello World!");

我会想象方法在NET4添加为并行扩展的一部分,但是我的生活中,我能够找到正确的命名空间的扩展方法。

I would imagine the method is an extension method added in net4 as part of the Parallel Extensions however for the life of me I can find the correct namespace.

Wouls任你铁杆csharpers请洒下的光。

Wouls any of you hardcore csharpers please shed the light.

推荐答案

检查出来的 http://msdn.microsoft.com/en-us/vstudio/async.aspx (下更新1)<一个href=\"http://www.hanselman.com/blog/InstallingAndRunningNodejsApplicationsWithinIISOnWindowsAreYouMad.aspx\" rel=\"nofollow\">http://www.hanselman.com/blog/InstallingAndRunningNodejsApplicationsWithinIISOnWindowsAreYouMad.aspx

Check out and http://msdn.microsoft.com/en-us/vstudio/async.aspx (under update 1) http://www.hanselman.com/blog/InstallingAndRunningNodejsApplicationsWithinIISOnWindowsAreYouMad.aspx

可以设置你的行权

这篇关于异步HttpHandlers的和WriteAsync的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆