/// <summary> /// Creates a new JavaScript engine and adds it to the list of all available engines. /// </summary> protected virtual T CreateEngine() { var engine = _engineFactory(); _config.Initializer(engine); _metadata[engine] = new EngineMetadata(); return(engine); }
/// <summary> /// Creates a new JavaScript engine and adds it to the list of all available engines. /// </summary> protected virtual TPooled CreateEngine() { var engine = new TPooled { InnerEngine = _engineFactory(), }; engine.ReturnEngineToPool = () => ReturnEngineToPoolInternal(engine); _config.Initializer(engine.InnerEngine); _metadata[engine] = new EngineMetadata(); return(engine); }
/// <summary> /// Creates a new JavaScript engine and adds it to the list of all available engines. /// </summary> protected virtual IJsEngine CreateEngine() { var engine = _engineFactory(); _config.Initializer(engine); _metadata[engine] = new EngineMetadata(); Interlocked.Increment(ref _engineCount); return engine; }
/// <summary> /// Creates a new JavaScript engine and adds it to the list of all available engines. /// </summary> protected virtual IJsEngine CreateEngine() { var engine = _engineFactory(); _config.Initializer(engine); _metadata[engine] = new EngineMetadata(); return engine; }