在 ASP.NET Web 请求期间评估 IronPython 脚本;是否静态引擎

发布于 2024-09-01 10:42:18 字数 228 浏览 4 评论 0原文

我想创建一个 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

桜花祭 2024-09-08 10:42:18

我刚刚开始在 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 ;)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文