fix #189 startup is too slow

This commit is contained in:
qianlifeng
2014-11-27 12:14:02 +08:00
parent 90c7bf4413
commit 217a7a34f8
3 changed files with 2 additions and 150 deletions

View File

@@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using Wox.Helper;
using Wox.Infrastructure.Storage.UserSettings;
using Wox.Plugin;
@@ -20,19 +21,16 @@ namespace Wox.PluginLoader
plugins.AddRange(new CSharpPluginLoader().LoadPlugin(pluginMetadatas));
plugins.AddRange(new BasePluginLoader<PythonPlugin>().LoadPlugin(pluginMetadatas));
Forker forker = new Forker();
foreach (PluginPair pluginPair in plugins)
{
PluginPair pair = pluginPair;
forker.Fork(() => pair.Plugin.Init(new PluginInitContext()
ThreadPool.QueueUserWorkItem(o => pair.Plugin.Init(new PluginInitContext()
{
CurrentPluginMetadata = pair.Metadata,
Proxy = HttpProxy.Instance,
API = App.Window
}));
}
forker.Join();
}
public static List<PluginPair> AllPlugins