A bit more frugal on the caller side of closing agents, now that the receiving end is async. No need for so much concurrency.
parent
52f88f5739
commit
c18bcf3d8d
|
@ -258,13 +258,17 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public delegate void SendCloseChildAgentDelegate(UUID agentID, ulong regionHandle);
|
//public delegate void SendCloseChildAgentDelegate(UUID agentID, ulong regionHandle);
|
||||||
|
//private void SendCloseChildAgentCompleted(IAsyncResult iar)
|
||||||
|
//{
|
||||||
|
// SendCloseChildAgentDelegate icon = (SendCloseChildAgentDelegate)iar.AsyncState;
|
||||||
|
// icon.EndInvoke(iar);
|
||||||
|
//}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// This Closes child agents on neighboring regions
|
/// Closes a child agent on a given region
|
||||||
/// Calls an asynchronous method to do so.. so it doesn't lag the sim.
|
|
||||||
/// </summary>
|
/// </summary>
|
||||||
protected void SendCloseChildAgentAsync(UUID agentID, ulong regionHandle)
|
protected void SendCloseChildAgent(UUID agentID, ulong regionHandle)
|
||||||
{
|
{
|
||||||
|
|
||||||
m_log.Debug("[INTERGRID]: Sending close agent to " + regionHandle);
|
m_log.Debug("[INTERGRID]: Sending close agent to " + regionHandle);
|
||||||
|
@ -277,21 +281,21 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
m_scene.SimulationService.CloseAgent(destination, agentID);
|
m_scene.SimulationService.CloseAgent(destination, agentID);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void SendCloseChildAgentCompleted(IAsyncResult iar)
|
/// <summary>
|
||||||
{
|
/// Closes a child agents in a collection of regions. Does so asynchronously
|
||||||
SendCloseChildAgentDelegate icon = (SendCloseChildAgentDelegate)iar.AsyncState;
|
/// so that the caller doesn't wait.
|
||||||
icon.EndInvoke(iar);
|
/// </summary>
|
||||||
}
|
/// <param name="agentID"></param>
|
||||||
|
/// <param name="regionslst"></param>
|
||||||
public void SendCloseChildAgentConnections(UUID agentID, List<ulong> regionslst)
|
public void SendCloseChildAgentConnections(UUID agentID, List<ulong> regionslst)
|
||||||
|
{
|
||||||
|
Util.FireAndForget(delegate
|
||||||
{
|
{
|
||||||
foreach (ulong handle in regionslst)
|
foreach (ulong handle in regionslst)
|
||||||
{
|
{
|
||||||
SendCloseChildAgentDelegate d = SendCloseChildAgentAsync;
|
SendCloseChildAgent(agentID, handle);
|
||||||
d.BeginInvoke(agentID, handle,
|
|
||||||
SendCloseChildAgentCompleted,
|
|
||||||
d);
|
|
||||||
}
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<GridRegion> RequestNamedRegions(string name, int maxNumber)
|
public List<GridRegion> RequestNamedRegions(string name, int maxNumber)
|
||||||
|
|
Loading…
Reference in New Issue