evaluation value
, e.g. +4
, -10
.
book file path
, search level
, advanced indicator
.
The technical point of pedax is as follows.
So, I have to use some isolates with ffi(libedax4dart) to achieve seamless non-blocking UI.
%% https://mermaid-js.github.io/mermaid/#/sequenceDiagram
sequenceDiagram
actor User
participant MainIsolate as Main Isolate
participant EdaxServer as Edax Server
participant EphemeralWorker as Ephemeral Worker
participant EdaxProcess as Edax Process [C]
link EdaxServer: source @ https://github.com/sensuikan1973/pedax/tree/main/lib/engine
link EdaxServer: caller @ https://github.com/sensuikan1973/pedax/blob/main/lib/models/board_notifier.dart
link EphemeralWorker: source @ https://github.com/sensuikan1973/pedax/tree/main/lib/engine
link EdaxProcess: binding source (Dart) @ https://github.com/sensuikan1973/libedax4dart
link EdaxProcess: origin source(C) @ https://github.com/sensuikan1973/edax-reversi/tree/libedax_sensuikan1973
User ->> MainIsolate: launch pedax
MainIsolate ->> EdaxServer: spawn and notify my SendPort
EdaxServer ->> MainIsolate: notify my SendPort<br/>and start listening
EdaxServer ->> EdaxProcess: initialize via ffi
User ->> MainIsolate: action (e.g. tap)
MainIsolate ->> EdaxServer: request EdaxCommand<br/>via SendPort
alt light EdaxCommand
EdaxServer ->> EdaxProcess: stop EdaxCommand being executed via ffi
EdaxServer ->> EdaxProcess: execute requested EdaxCommand via ffi
EdaxProcess ->> EdaxServer: return result
EdaxServer ->> MainIsolate: notify result via SenPort
MainIsolate ->> MainIsolate: update UI
else heavy EdaxCommand
note right of EdaxServer: spawn another isolate not to block EdaxServer.<br>Then, EdaxServer can accept other requests.
EdaxServer ->>+ EphemeralWorker: spawn and notify Main Isolate SendPort
EphemeralWorker ->> EdaxProcess: stop EdaxCommand being executed via ffi
EphemeralWorker ->> EdaxProcess: execute requested EdaxCommand via ffi
note over EdaxProcess: heavy...
EdaxProcess ->> EphemeralWorker: return result
EphemeralWorker ->>- MainIsolate: notify result via SenPort
MainIsolate ->> MainIsolate: update UI
end
./scripts/setup_flutter.sh
flutter run --device-id macos --dart-define "SENTRY_DSN=xxx" # env is optional