在 ASP.NET Web 请求期间评估 IronPython 脚本;是否静态引擎
我想创建一个 ASP.NET MVC Web 应用程序,它具有不需要重新构建的可扩展逻辑。我正在考虑创建一个包含 IronPython 引擎实例的过滤器。我想知道的是:在每个网络请求期间创建新引擎有多少开销,以及保留静态引擎是否是一个更好的主意?但是,如果我要保留单个静态引擎,那么就锁定和脚本范围而言我可能会遇到哪些问题?是否可以在同一个 IropPython 引擎中拥有多个作用域,这样我就不会在 Web 请求之间出现变量冲突和安全问题?
I would like to create an ASP.NET MVC web application which has extensible logic that does not require a re-build. I was thinking of creating a filter which had an instance of the IronPython engine. What I would like to know is: how much overhead is there in creating a new engine during each web request, and would it be a better idea to keep a static engine around? However, if I were to keep a single static engine around, what are the issues I might run into as far as locking and script scope? Is it possible to have multiple scopes in the same IropPython engine so I don't get variable collision and security issues between web requests?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我刚刚开始在 ASP.NET MVC 应用程序中使用 IronPython 作为扩展点。我有一个 ipy 引擎(在静态属性中),对于每个请求,我创建新的作用域并在该作用域中执行脚本。
每个作用域应该独立于其他作用域,不需要锁定。
如果我遇到问题,我会将其发布在这里。不过,我并不期待任何;)
I've just started using IronPython as extensibility point in my ASP.NET MVC aplication. I have one ipy engine (in static property) and for each request I create new scope and execute the script in that scope.
Each scope should be independent on other scopes, no locking is needed.
If I run into issues, I'll post it here. However, I don't expect any ;)