diff options
author | Diva Canto | 2009-08-19 00:33:02 -0700 |
---|---|---|
committer | Diva Canto | 2009-08-19 00:33:02 -0700 |
commit | 4382f28efc6ffe70e3c6f6e8cd7e7c729d1f12af (patch) | |
tree | 135b6061eb7589d31d6e1cb6d7f5b67dfd09a3b1 /OpenSim/Region/Framework | |
parent | Merge branch 'master' of ssh://diva@opensimulator.org/var/git/opensim (diff) | |
download | opensim-SC-4382f28efc6ffe70e3c6f6e8cd7e7c729d1f12af.zip opensim-SC-4382f28efc6ffe70e3c6f6e8cd7e7c729d1f12af.tar.gz opensim-SC-4382f28efc6ffe70e3c6f6e8cd7e7c729d1f12af.tar.bz2 opensim-SC-4382f28efc6ffe70e3c6f6e8cd7e7c729d1f12af.tar.xz |
Async purge so that the client thread doesn't wait.
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs b/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs index a2414e5..77b980c 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs | |||
@@ -25,6 +25,7 @@ | |||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
26 | */ | 26 | */ |
27 | 27 | ||
28 | using System; | ||
28 | using System.Collections.Generic; | 29 | using System.Collections.Generic; |
29 | using System.Threading; | 30 | using System.Threading; |
30 | using OpenMetaverse; | 31 | using OpenMetaverse; |
@@ -558,15 +559,34 @@ namespace OpenSim.Region.Framework.Scenes | |||
558 | /// <param name="remoteClient"></param> | 559 | /// <param name="remoteClient"></param> |
559 | /// <param name="folderID"></param> | 560 | /// <param name="folderID"></param> |
560 | 561 | ||
562 | delegate void PurgeFolderDelegate(UUID userID, UUID folder); | ||
563 | |||
561 | public void HandlePurgeInventoryDescendents(IClientAPI remoteClient, UUID folderID) | 564 | public void HandlePurgeInventoryDescendents(IClientAPI remoteClient, UUID folderID) |
562 | { | 565 | { |
563 | InventoryFolderBase folder = new InventoryFolderBase(folderID, remoteClient.AgentId); | 566 | PurgeFolderDelegate d = PurgeFolderAsync; |
567 | try | ||
568 | { | ||
569 | d.BeginInvoke(remoteClient.AgentId, folderID, PurgeFolderCompleted, d); | ||
570 | } | ||
571 | catch (Exception e) | ||
572 | { | ||
573 | m_log.WarnFormat("[AGENT INVENTORY]: Exception on purge folder for user {0}: {1}", remoteClient.AgentId, e.Message); | ||
574 | } | ||
575 | } | ||
576 | |||
577 | |||
578 | private void PurgeFolderAsync(UUID userID, UUID folderID) | ||
579 | { | ||
580 | InventoryFolderBase folder = new InventoryFolderBase(folderID, userID); | ||
564 | 581 | ||
565 | if (InventoryService.PurgeFolder(folder)) | 582 | if (InventoryService.PurgeFolder(folder)) |
566 | m_log.DebugFormat("[AGENT INVENTORY]: folder {0} purged successfully", folderID); | 583 | m_log.DebugFormat("[AGENT INVENTORY]: folder {0} purged successfully", folderID); |
567 | else | 584 | else |
568 | m_log.WarnFormat("[AGENT INVENTORY]: could not purge folder {0}", folderID); | 585 | m_log.WarnFormat("[AGENT INVENTORY]: could not purge folder {0}", folderID); |
569 | } | 586 | } |
570 | 587 | ||
588 | private void PurgeFolderCompleted(IAsyncResult iar) | ||
589 | { | ||
590 | } | ||
571 | } | 591 | } |
572 | } | 592 | } |