public void Stop() { if (!m_running) { return; } m_running = false; Thread.Sleep(100); // let the world move try { while (m_retryRequests.TryDequeue(out PollServiceHttpRequest req)) { req.DoHTTPstop(); } } catch { } int count = 10; while (--count > 0 && m_workerPool.Count > 0) { Thread.Sleep(100); } m_workerPool.Dispose(); m_workerPool = null; }
public void Close() { if (m_NumberScenes <= 0 && m_workerpool != null) { m_workerpool.Dispose(); m_workerpool = null; } }
public void Close() { if (!m_Enabled) { return; } m_requestQueue.Dispose(); m_requestQueue = null; }
public void Initialise(IConfigSource source) { IConfig moduleConfig = source.Configs["Modules"]; if (moduleConfig != null) { string name = moduleConfig.GetString("AssetServices", ""); if (name == Name) { IConfig assetConfig = source.Configs["AssetService"]; if (assetConfig == null) { m_log.Error("[REGIONASSETCONNECTOR]: AssetService missing from configuration files"); throw new Exception("Region asset connector init error"); } string localGridConnector = assetConfig.GetString("LocalGridAssetService", string.Empty); if (string.IsNullOrEmpty(localGridConnector)) { m_log.Error("[REGIONASSETCONNECTOR]: LocalGridAssetService missing from configuration files"); throw new Exception("Region asset connector init error"); } object[] args = new object[] { source }; m_localConnector = ServerUtils.LoadPlugin <IAssetService>(localGridConnector, args); if (m_localConnector == null) { m_log.Error("[REGIONASSETCONNECTOR]: Fail to load local asset service " + localGridConnector); throw new Exception("Region asset connector init error"); } string HGConnector = assetConfig.GetString("HypergridAssetService", string.Empty); if (!string.IsNullOrEmpty(HGConnector)) { m_HGConnector = ServerUtils.LoadPlugin <IAssetService>(HGConnector, args); if (m_HGConnector == null) { m_log.Error("[REGIONASSETCONNECTOR]: Fail to load HG asset service " + HGConnector); throw new Exception("Region asset connector init error"); } IConfig hgConfig = source.Configs["HGAssetService"]; if (hgConfig != null) { m_AssetPerms = new AssetPermissions(hgConfig); } } m_localRequestsQueue = new ObjectJobEngine(AssetRequestProcessor, "GetAssetsWorkers", 2000, 2); m_remoteRequestsQueue = new ObjectJobEngine(AssetRequestProcessor, "GetRemoteAssetsWorkers", 2000, 2); m_Enabled = true; m_log.Info("[REGIONASSETCONNECTOR]: enabled"); } } }
public void Close() { if (!m_Enabled) { return; } m_localRequestsQueue.Dispose(); m_localRequestsQueue = null; m_remoteRequestsQueue.Dispose(); m_remoteRequestsQueue = null; }
public void Stop() { try { m_running = false; workQueue.Dispose(); workQueue = null; } catch { } }
public void Start() { if (m_running) { return; } m_running = true; m_workerPool = new ObjectJobEngine(PoolWorkerJob, "PollServiceWorker", 4000, m_WorkerThreadCount); m_retrysThread = WorkManager.StartThread( CheckRetries, string.Format("PollServiceWatcherThread"), ThreadPriority.Normal, true, true, null, 1000 * 60 * 10); }
public virtual void Initialise(IConfigSource config) { IConfig cnf = config.Configs["Messaging"]; if (cnf != null) { if (cnf.GetString("MessageTransferModule", "MessageTransferModule") != "MessageTransferModule") { return; } m_MessageKey = cnf.GetString("MessageKey", String.Empty); } m_log.Debug("[MESSAGE TRANSFER]: Module enabled"); m_Enabled = true; IMXMLRPCSendWorkers = new ObjectJobEngine(DoSendIMviaXMLRPC, "IMXMLRPCSendWorkers", 1000, 3); }
public void Close() { if (!m_Enabled) { return; } if (ProcessQueuedRequestsAsync) { if (m_NumberScenes <= 0 && m_workerpool != null) { m_workerpool.Dispose(); m_workerpool = null; m_badRequests.Dispose(); m_badRequests = null; } } // m_queue.Dispose(); }
public ODEMeshWorker(ODEScene pScene, ILog pLog, IMesher pMesher, IConfig pConfig) { m_scene = pScene; m_log = pLog; m_mesher = pMesher; if (pConfig != null) { meshSculptedPrim = pConfig.GetBoolean("mesh_sculpted_prim", meshSculptedPrim); meshSculptLOD = pConfig.GetFloat("mesh_lod", meshSculptLOD); MinSizeToMeshmerize = pConfig.GetFloat("mesh_min_size", MinSizeToMeshmerize); MeshSculptphysicalLOD = pConfig.GetFloat("mesh_physical_lod", MeshSculptphysicalLOD); } m_running = true; Util.FireAndForget(DoCacheExpire, null, "OdeCacheExpire", false); lock (m_threadLock) { if (workQueue == null) { workQueue = new ObjectJobEngine(DoWork, "OdeMeshWorker"); } } }
public void RegionLoaded(Scene s) { if (!m_Enabled) { return; } lock (m_loadLock) { if (m_assetService == null) { m_assetService = s.RequestModuleInterface <IAssetService>(); // We'll reuse the same handler for all requests. m_getAssetHandler = new GetAssetsHandler(m_assetService); } if (m_assetService == null) { m_Enabled = false; return; } if (m_UserManagement == null) { m_UserManagement = s.RequestModuleInterface <IUserManagement>(); } s.EventManager.OnRegisterCaps += RegisterCaps; m_NumberScenes++; if (m_workerpool == null) { m_workerpool = new ObjectJobEngine(DoAssetRequests, "GetCapsAssetWorker", 1000, 3); } } }
public Dataserver(AsyncCommandManager CmdManager) { m_CmdManager = CmdManager; m_WorkPool = new ObjectJobEngine(ProcessActions, "ScriptDataServer", 1000, 4); }
public void RegionLoaded(Scene s) { if (!m_Enabled) { return; } if (s_processedRequestsStat == null) { s_processedRequestsStat = new Stat( "ProcessedFetchInventoryRequests", "Number of processed fetch inventory requests", "These have not necessarily yet been dispatched back to the requester.", "", "inventory", "httpfetch", StatType.Pull, MeasuresOfInterest.AverageChangeOverTime, stat => { stat.Value = ProcessedRequestsCount; }, StatVerbosity.Debug); } if (s_queuedRequestsStat == null) { s_queuedRequestsStat = new Stat( "QueuedFetchInventoryRequests", "Number of fetch inventory requests queued for processing", "", "", "inventory", "httpfetch", StatType.Pull, MeasuresOfInterest.AverageChangeOverTime, stat => { stat.Value = m_workerpool.Count; }, StatVerbosity.Debug); } StatsManager.RegisterStat(s_processedRequestsStat); StatsManager.RegisterStat(s_queuedRequestsStat); m_InventoryService = Scene.InventoryService; m_LibraryService = Scene.LibraryService; // We'll reuse the same handler for all requests. m_webFetchHandler = new FetchInvDescHandler(m_InventoryService, m_LibraryService, Scene); Scene.EventManager.OnRegisterCaps += RegisterCaps; if (m_badRequests == null) { m_badRequests = new ExpiringKey <UUID>(30000); } m_NumberScenes++; if (ProcessQueuedRequestsAsync && m_workerpool == null) { m_workerpool = new ObjectJobEngine(DoInventoryRequests, "InventoryWorker", 2000, 2); } }