IsolateSlave constructor
IsolateSlave(
- IsoactionInternalInit actionInit
Implementation
IsolateSlave(IsoactionInternalInit actionInit)
: _masterPort = actionInit.port,
_pingCount = 1 {
_portReceive = RawReceivePort(_processMessage);
_portTransmit = _portReceive?.sendPort;
//Do not reply to UX side yet, it needs to happen
//after the parent class has fully initialized
//Call the replyInit() inside the constructor of parent class
_pingCount = 1;
Timer.periodic(Duration(seconds: 30), (_) {
var actionPing = IsoactionInternalPing();
actionPing.count = _pingCount++;
sendToMaster(actionPing);
});
}