mirror of
https://github.com/opensim/opensim.git
synced 2026-08-12 20:55:43 +08:00
Connect up the new asset cache and introduce an asynchronous call path
for asset retrieval (full asset only) to ease migration to the new system
This commit is contained in:
@@ -45,6 +45,9 @@ namespace OpenSim.Region.CoreModules.Asset
|
||||
MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
private bool m_Enabled = false;
|
||||
private Cache m_Cache = new Cache(CacheMedium.Memory,
|
||||
CacheStrategy.Aggressive,
|
||||
CacheFlags.AllowUpdate);
|
||||
|
||||
public string Name
|
||||
{
|
||||
@@ -69,6 +72,8 @@ namespace OpenSim.Region.CoreModules.Asset
|
||||
m_Enabled = true;
|
||||
|
||||
m_log.Info("[ASSET CACHE]: Core asset cache enabled");
|
||||
|
||||
m_Cache.Size = 32768;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -99,19 +104,22 @@ namespace OpenSim.Region.CoreModules.Asset
|
||||
|
||||
public void Cache(AssetBase asset)
|
||||
{
|
||||
m_Cache.Store(asset.ID, asset);
|
||||
}
|
||||
|
||||
public AssetBase Get(string id)
|
||||
{
|
||||
return null;
|
||||
return (AssetBase)m_Cache.Get(id);
|
||||
}
|
||||
|
||||
public void Expire(string id)
|
||||
{
|
||||
m_Cache.Invalidate(id);
|
||||
}
|
||||
|
||||
public void Clear()
|
||||
{
|
||||
m_Cache.Clear();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user