* ARequest changed name to AssetRequest and moved to own file.

* The AssetServerBase is now responsible for dequeueing, the server implementations merely recieves ProcessRequest( AssetRequest req )
* Catchall added around queue processing thread so thread won't abort on exceptions.
This commit is contained in:
lbsa71
2007-12-14 08:47:15 +00:00
parent 79935881aa
commit 0a4a5bbcef
6 changed files with 105 additions and 108 deletions

View File

@@ -57,7 +57,7 @@ namespace OpenSim.Framework.Communications.Cache
if (typeInterface != null)
{
IAssetProvider plug =
(IAssetProvider) Activator.CreateInstance(pluginAssembly.GetType(pluginType.ToString()));
(IAssetProvider)Activator.CreateInstance(pluginAssembly.GetType(pluginType.ToString()));
m_assetProviderPlugin = plug;
m_assetProviderPlugin.Initialise();
@@ -65,12 +65,8 @@ namespace OpenSim.Framework.Communications.Cache
"Added " + m_assetProviderPlugin.Name + " " +
m_assetProviderPlugin.Version);
}
typeInterface = null;
}
}
pluginAssembly = null;
}
@@ -81,27 +77,20 @@ namespace OpenSim.Framework.Communications.Cache
m_assetProviderPlugin.CommitAssets();
}
protected override void RunRequests()
protected override void ProcessRequest(AssetRequest req)
{
while (true)
AssetBase asset;
lock (syncLock)
{
ARequest req = _assetRequests.Dequeue();
//MainLog.Instance.Verbose("AssetStorage","Requesting asset: " + req.AssetID);
AssetBase asset = null;
lock (syncLock)
{
asset = m_assetProviderPlugin.FetchAsset(req.AssetID);
}
if (asset != null)
{
_receiver.AssetReceived(asset, req.IsTexture);
}
else
{
_receiver.AssetNotFound(req.AssetID);
}
asset = m_assetProviderPlugin.FetchAsset(req.AssetID);
}
if (asset != null)
{
_receiver.AssetReceived(asset, req.IsTexture);
}
else
{
_receiver.AssetNotFound(req.AssetID);
}
}