浏览代码

Messages will be consumed when the side channel registers (#3573)

* Messages will be consumed when the side channel registers

* addressing the comment

* Update com.unity.ml-agents/Runtime/Communicator/RpcCommunicator.cs

Co-Authored-By: Chris Elion <chris.elion@unity3d.com>

Co-authored-by: Chris Elion <celion@gmail.com>
/bug-failed-api-check
GitHub 5 年前
当前提交
9ae290ee
共有 1 个文件被更改,包括 14 次插入0 次删除
  1. 14
      com.unity.ml-agents/Runtime/Communicator/RpcCommunicator.cs

14
com.unity.ml-agents/Runtime/Communicator/RpcCommunicator.cs


"A side channel with type index {0} is already registered. You cannot register multiple " +
"side channels of the same id.", channelId));
}
var numMessages = m_CachedMessages.Count;
for (int i = 0; i < numMessages; i++)
{
var cachedMessage = m_CachedMessages.Dequeue();
if (channelId == cachedMessage.ChannelId)
{
sideChannel.OnMessageReceived(cachedMessage.Message);
}
else
{
m_CachedMessages.Enqueue(cachedMessage);
}
}
m_SideChannels.Add(channelId, sideChannel);
}

正在加载...
取消
保存