Skip to content

Commit

Permalink
stop method to manually stop the simulation before it completes. #14
Browse files Browse the repository at this point in the history
  • Loading branch information
caduandrade committed Feb 26, 2025
1 parent c0a1256 commit 1c3ee0f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
## 0.3.0

* Access the list of created resources.
* Added: `runState` to check if the simulation has not started, is running, or has completed.
* Added
* `runState` getter to determine whether the simulation has not started, is running, or has completed.
* `stop` method to manually stop the simulation before it completes.

## 0.2.0

Expand Down
4 changes: 4 additions & 0 deletions lib/src/simdart.dart
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,10 @@ class SimDart implements SimDartInterface {
return _buildResult();
}

void stop() {
_terminator?.complete();
}

@override
SimCounter counter(String name) {
return _counterProperties.putIfAbsent(name, () => SimCounter(name: name));
Expand Down

0 comments on commit 1c3ee0f

Please sign in to comment.