Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/misc api changes #63

Merged
merged 4 commits into from
Nov 15, 2024
Merged

Feature/misc api changes #63

merged 4 commits into from
Nov 15, 2024

Conversation

sbarral
Copy link
Member

@sbarral sbarral commented Nov 15, 2024

Simplified and more uniform API:

  • More uniform and simpler Context and BuildContext APIs (both are now passed by &mut for future-proofing),
  • SimInit now returns a tuple with both a Simulation and a Scheduler,
  • The LineId API was removed -- it probably wasn't used and risked becoming a liability.

Previously, the scheduler key used the target model as subkey to order
messages that target the same model.

Now this subkey is the origin model rather than the target, or in the
case of the global scheduler, 0. This doesn't change anythin in practice
for the local scheduler since the origin and target models were the
same, but for the global scheduler this provides additional guarranties.

For instance, if the global scheduler is used to schedule an event
targetting model A and then an event targetting model B where the latter
triggers a message to A, it is now guarranteed that the first message
will get to A before the second.
The API style is now more uniform: both are passed by mutable ref, and
only expose accessors. Additionally, the methods that were initially
accessed through the scheduler field are now directly implemented on
`Context`.
This was probably never used.
@jauhien jauhien merged commit c749a49 into main Nov 15, 2024
9 checks passed
@sbarral sbarral deleted the feature/misc_api_changes branch November 16, 2024 12:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants