Create a ModelRunner around a GeneratedModel to run that model either synchronously or asynchronously.
- ModelRunner
- createSynchronousModelRunner (see
@sdeverywhere/runtime-asyncpackage for asynchronous variant)
Optional: Create a ModelScheduler or
MultiContextModelScheduler
around a ModelRunner to simplify the process of running the model on demand.
These classes are especially useful in web applications built with a reactive framework.
NOTE: The main difference between these two classes is that MultiContextModelScheduler
allows for using multiple "contexts" (i.e., distinct sets of inputs and outputs) with
the same underlying model instance, while ModelScheduler effectively only supports a
single context. These two APIs will be combined prior to version 1.0 of the runtime
package.
The InputValue API is generally only needed when working with the ModelScheduler or
MultiContextModelScheduler classes.
Use the Outputs class to access the model outputs that are stored after
each model run by the ModelRunner.
Note: Most developers will not need to interact with these low-level APIs directly. These are exposed only to show the shape of models that are generated by the SDEverywhere compiler.