zencoder-cs
zencoder-cs copied to clipboard
Extend or overload INotificationReceiver for passing HttpContext
A suggestion is to extend INotificationReciever to include the HttpContext to the OnRecieve method.
The reason to this is to be able to access context.Server.MapPath() to store data received from Zencoder.
Example: public void OnReceive(HttpPostNotification notification, HttpContext context)
PS: I have already done this for my application and maybe try to create a fork and sending you a pull request. :)
Just ran into this problem myself, accessing HttpContext.Current (even if you modify the INotificationReceiver to contain it) is not threadsafe I think, since if the original processing thread goes away, the HttpContext calls will fail. I have changed my notification method to use System.Web.Hosting.HostingEnvironment.MapPath() rather than HttpContext.Current.Server.MapPath The only other thing you might need from HttpContext.Current is Session but similar problems exist here with cross threading.