[IronPython] Passing Arguments in hosted enviroment

Bernd Rössl broessl at gmc.li
Mon Sep 11 21:02:22 CEST 2006

Hey David, thanks for your help.

Passing the args to a session dependend context seams to be not as abstract
as i thought...i will do so.

I think i can't pass on 'ExecuteFile' because there are a lot of different
scripts that can be edited during runtime. This scripts
aren't simple methods (currently they are) which can be realized in a lambda
function. They could be quite complex. 

But i agree to prefere precompiled stuff to execute. Doesn't IronPython
handles this out of the box like CPython?


David Ebbo wrote:
> Hi Bernd,
> I would recommend against calling ExecuteFile on each request, as that
> would cause the code to be parsed and compiled every time (very
> inefficient).  Instead, one thing you can do is:
> -          On the first request, create an EngineModule
> -          Call ExecuteFile, passing your module
> -          Find methods that you care about in EngineModule.Globals
> -          Then on every request, you can call those methods, passing it
> arguments that are specific to the current request (e.g. the HttpContext)
> You can also look at CreateLambda and CreateMethod, which may make more
> sense depending on your specific scenario (i.e. what kind of code you are
> executing).
> David

View this message in context: http://www.nabble.com/Passing-Arguments-in-hosted-enviroment-tf2232218.html#a6252709
Sent from the IronPython forum at Nabble.com.

More information about the Ironpython-users mailing list