call method
Implementation
@override
Future<void> call(SendPort sendport) async {
await onInit?.call(initData);
final ReceivePort receivePort = ReceivePort();
sendport.send(receivePort.sendPort);
receivePort.listen((message) {
if (message is _WorkerExit) {
receivePort.close();
return;
}
if (message is MessageWithID<I>) {
final (id, payload) = message;
entry(payload, (response) {
sendport.send((id, response));
});
return;
}
entry(message, sendport.send);
});
}