public EvalSession(IVaultCompiler compiler, IVault repository) { _expositions.Add(compiler.AssertNotNull().Vault.ExposeReadOnly()); if (repository != null) { _expositions.Add(repository.AssertNotNull().ExposeReadOnly()); } var cache = compiler.GetCompiledAsync(); if (cache != null) { Scenario = cache.RequestInstance(repository); _evalExposition = Scenario.Expose(); } else { // if cache returned is null, this means that the compiler is busy generating an assembly // however, we don't want to make user wait so let's just fall back to 5-10x times slower Eval2 Eval2 = new Ver2.EvalSession(compiler.Vault, repository); _evalExposition = Eval2; } }
public EvalSession(IVaultCompiler compiler) : this(compiler, null) { }