开发者

IHttpAsyncHandler instance use by the runtime

开发者 https://www.devze.com 2023-03-09 22:26 出处:网络
Given an IHttpAsyncHandler instance A, will A be the instance that receives the EndProcessRequest callback?If so, it is guaranteed?Does the IsReusable property alter the behavior at all?

Given an IHttpAsyncHandler instance A, will A be the instance that receives the EndProcessRequest callback? If so, it is guaranteed? Does the IsReusable property alter the behavior at all?

It's complicated enough to try to test that I wanted to reach out and see if someone else had already been down this road.

I currently have a IHttpAsyncHandler that uses a state object that gets sent to EndProcessRequest and everything is working perfectly. However, I开发者_开发知识库 could clean the code considerably if I could preserve state in an instance level variable like a property or field.

Thoughts?


Yes, the same instance will be called in the EndProcessRequest method.

If you are putting per request state on the handler though, the isReusable getter should return 'false', otherwise the ASP.NET run time will not re-instantiate your handler from request to request instead of recreating a whole new instance per request.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号