stockfishAsync function
Creates a C++ engine asynchronously.
This method is different from the factory method Stockfish that it will wait for the engine to be ready before returning the instance.
Implementation
Future<Stockfish> stockfishAsync() {
if (Stockfish._instance != null) {
return Future.error(StateError('Only one instance can be used at a time'));
}
final completer = Completer<Stockfish>();
Stockfish._instance = Stockfish._(completer: completer);
return completer.future;
}