Statment reached after persisted Yield
I've created a couple of ports whose handlers are iterators. I added them to the concurrent group of an interleave then I posted to one of the ports. The code in the handler never executes.
public class myService : DsspServiceBase
{
// some code here ...
private Port<irobot.RoombaState> _bumperStatePort = new
Port<irobot.RoombaState>();
private Port<irobot.RoombaState> _wheeldropStatePort = new
Port<irobot.RoombaState>();
// some code here ...
private void OneTimeStartupMethod()
{
// some code here ...
yield return Arbiter.Interleave(
new TeardownReceiverGroup(),
new ExclusiveReceiverGroup(),
new ConcurrentReceiverGroup(
Arbiter.ReceiveWithIterator(true, _bumperStatePort,
BumperStateHandler),
Arbiter.ReceiveWithIterator(true, _wheeldropStatePort,
WheeldropStateHandler)));
_bumperStatePort.Post(_state.CreateState);
// some code here ...
}
// some code here ...
private IEnumerator<ITask> BumperStateHandler(irobot.RoombaState fullState)
{
LogInfo("Starting UpdatePowerHandler");
if (_state.CreateState == null)
{
LogError("CreateState was null in BumperStateHandler");
yield break;
}
if (fullState.Sensors.BumpsWheeldrops
!= _state.CreateState.Sensors.BumpsWheeldrops)
{
LogInfo("Identified bump or wheeldrop");
}
yield break;
}
private IEnumerator<ITask> WheeldropStateHandler(irobot.RoombaState fullState)
{
LogInfo("Starting WheeldropStateHandler");
if (_state.CreateState == null)
{
LogError("CreateState was null in WheeldropStateHandler");
yield break;
}
if (fullState.Sensors.BumpsWheeldrops
!= _state.CreateState.Sensors.BumpsWheeldrops)
{
LogInfo("Identified bump or wheeldrop");
}
yield break;
}
}
All the logs work except the ones in the handler. I must be missing a step. Any ideas?
Thanks,
Dogulas

