IHttpAsyncHandler instance use by the runtime
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.
精彩评论